Project: Distance fallen

Use this formula to find how far an object falls in a given time because of gravity:

d = (1/2)gt2

where d is the distance in meters, g is 9.8, and t is the time in seconds.

Write a function called distance_fallen that takes a time in seconds as an argument and returns the distance the object has fallen in that time. Here is how it could be used:

dist = distance_fallen(4.5)
print(dist)

Save the file as distance_fallen.py.

Show a solution

Try the project on your own first. This is one working solution, followed by its tests. Press Run to run the tests. Read them to see what thorough testing looks like, then change the solution and run again to watch a test fail.

Projects run on your own computer, so you tell us when you are done.