Skip to content

Latest commit

 

History

History
17 lines (13 loc) · 577 Bytes

Functions-for-loop-Python.md

File metadata and controls

17 lines (13 loc) · 577 Bytes
layout topic title language
exercise
Functions
for Loop
Python

This is a follow up to the [Nested Functions problem]({{ site.baseurl }}/exercises/Functions-nested-functions-Python).

Now that you've impressed Grandma, it's time to do some serious science. Take the following list of Stegosaur lengths

lengths = [10.1, 9.5, 11.2, 9.8, 10.4, 12.0, 11.5, 9.5, 9.8, 10.0, 10.7, 10.2, 11.9, 9.7, 11.2, 11.8, 10.7]

and estimate the mass in kilograms for each length using a for loop, your function for estimating mass, a=10.95, and b=2.64. Print the resulting list.