Skip to content

Instantly share code, notes, and snippets.

@alixander
Created January 5, 2018 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alixander/e7538f767722154966a89f9c4bb543a7 to your computer and use it in GitHub Desktop.
Save alixander/e7538f767722154966a89f9c4bb543a7 to your computer and use it in GitHub Desktop.
"""
A turtle and rabbit are in a race.
The race is 100 meters.
The turtle moves 2 meters per minute.
The rabbit moves 5 meters per minute.
Right before the rabbit passes the finish line, he sleeps for half an hour.
Write a function that simulates a race between the two
and return the final number of meters moved after one of them wins.
Assume the race is measured in seconds (e.g. seconds are the smallest unit of time)
"""
def race():
turtle_meters = 0
rabbit_meters = 0
return turtle_meters, rabbit_meters
print(race())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment