You can run the next cell to see a slideshow of that process In38 from

# You can run the next cell to see a slideshow of that

This preview shows page 10 - 12 out of 13 pages.

# # You can run the next cell to see a slideshow of that process.# In[38]:from IPython.display import IFrameIFrame('-nRsD8VJvcOnJsjmCy0Jpv752Ssn5Pphg2sMC-0/embed?start=false&loop=false&delayms=3000', 800, 600)# Ok, your turn. # # **Question 4.1.1.** <br /> Given the heights of the Splash Triplets from the Golden State Warriors, write an expression that computes the smallest differencebetween any of the three heights. Your expression shouldn't have any numbers in it, only function calls and the names `klay`, `steph`, and `kevin`. Give the value of your expression the name `min_height_difference`.# In[39]:# The three players' heights, in meters:klay = 2.01 # Klay Thompson is 6'7"steph = 1.91 # Steph Curry is 6'3"kevin = 2.06 # Kevin Durant is officially 6'9", but many suspect that he is taller.# (Further complicating matters, membership of the "Splash Triplets" # is disputed, since it was originally used in reference to # Klay Thompson, Steph Curry, and Draymond Green.)# We'd like to look at all 3 pairs of heights, compute the absolute
# difference between each pair, and then find the smallest of those# 3 absolute differences. This is left to you! If you're stuck,# try computing the value for each step of the process (like the# difference between Klay's heigh and Steph's height) on a separate# line and giving it a name (like klay_steph_height_diff).min_height_difference = min(abs(klay-steph),abs(klay-kevin),abs(steph-kevin))# In[40]:check('tests/q411.py')# ## 5. Tables# A website called [Gapminder]() collects a large variety of measurements of human health, education, and progress. Each measurement is published in a table that has one row per country and one column per year, describing how the measurement varies over time and place.# # For example, [this table](-WuUsJFumnE4s2UWdmlskv6r4/pub#) describes the average number of years of school attended by all women 25 and older. The table has a row for each of 175 countries and a column for each year from 1970 through 2009. The data were estimated for a study by the [Institute for Health Metrics and Evaluation]() called "Increased educational attainment and its impact on child mortality: a systematic analysis in 175 countries from 1970 to 2009" ([link](ainment/education_attainment.html&sa=D&ust=1522644678563000&usg=AFQjCNG-Rn_hO868jLLBz6FRLT8LSqwUVA)).# # To load tables into Python, you must first import the `datascience` module. The second line below makes sure that charts appear on the screen when you create them. You only need to execute these lines once per notebook (and each time you restart your kernel).# In[41]:# Don't change this cellfrom datascience import *get_ipython().run_line_magic('matplotlib', 'inline')# Now, run the next cell in order to load the table describing years of school attended by women around the world and over time. Only the first 10 rows of the table will be displayed.

#### You've reached the end of your free preview.

Want to read all 13 pages?

• Fall '17
• Human height