In20 Change the next line so that it computes the number of seconds in a decade

In20 change the next line so that it computes the

This preview shows page 4 - 6 out of 13 pages.

# In[20]:# Change the next line so that it computes the number of# seconds in a decade and assigns that number the name# seconds_in_a_decade.secondes_per_day=60*60*24print(secondes_per_day)days_in_decade=365*10+2 #leap years: 2012, 2016print(days_in_decade)seconds_in_a_decade = secondes_per_day * days_in_decade# We've put this line in this cell so that it will print# the value you've given to seconds_in_a_decade when you# run it. You don't need to change this.seconds_in_a_decade# ### 2.1. Checking your code# Now that you know how to name things, you can start using the built-in *tests*to check whether your work is correct. Try not to change the contents of the test cells. # # The cell below appears only once in the notebook and loads all of the tests sothat they can be run later. You can load all of the tests before you answer all questions in the notebook. You will run tests as you go to check your work alongthe way, and you can also run all of the tests at the end to make sure that you will receive full credit on the lab.# In[16]:# These lines load the tests.from gofer.ok import check# Running the following cell will test whether you have assigned `seconds_in_a_decade` correctly in Question 2.2. # # Sometimes the tests will give hints about what went wrong. If the test doesn'tpass, read the output, adjust your answer to the question, run the answer cell again to update the name `seconds_in_a_decade`, then run this test cell again.
Background image
# # Sometimes the tests will tell you the answer. Rather than copying the answer, try to understand how it was reached. # In[21]:# Test cell; please do not change!check('tests/q22.py')# ### 2.2. Comments# You may have noticed this line in the cell above:# # # Test cell; please do not change!# # That is called a *comment*. It doesn't make anything happen in Python; Pythonignores anything on a line after a #. Instead, it's there to communicate something about the code to you, the human reader. Comments are extremely useful.# # <img src=" alt="comic about comments"># ### 2.3. Application: A physics experiment# # On the Apollo 15 mission to the Moon, astronaut David Scott famously replicated Galileo's physics experiment in which he showed that gravity accelerates objects of different mass at the same rate. Because there is no air resistance for a falling object on the surface of the Moon, even two objects with very different masses and densities should fall at the same rate. David Scott compared a feather and a hammer.# # You can run the following cell to watch a video of the experiment.# In[22]:from IPython.display import YouTubeVideo# The original URL is:# YouTubeVideo("U7db6ZeLR5s")# Here's the transcript of the video:# # **167:22:06 Scott**: Well, in my left hand, I have a feather; in my right hand, a hammer. And I guess one of the reasons we got here today was because of a gentleman named Galileo, a long time ago, who made a rather significant discovery about falling objects in gravity fields. And we thought where would bea better place to confirm his findings than on the Moon. And so we thought we'd try it here for you. The feather happens to be, appropriately, a falcon feather
Background image
Image of page 6

You've reached the end of your free preview.

Want to read all 13 pages?

  • Fall '17
  • Human height

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes