Work out distance (fill in the blanks)

/ Published in: Python
Save to your folder(s)

Students work out the code by filling in the blanks.

They must work out how far a vehicle has travelled based on speed and time.
Students will fill in the blanks

Copy this code and paste it in your HTML
  1. %%%%("this programme will work out how far someone has travelled in miles if you enter speed and time time travelled.")
  3. speed = int(%%%%("please enter the speed the vehicle was driving at"))
  5. time_hours = int(input("enter hours travelled"))
  6. time_mins = int(input("Enter minutes travelled"))/60
  7. time_sec = int(input("Enter seconds travelled"))/3600
  9. totaltime = time_hours+time_mins+time_sec
  11. distance = %%%%
  12. distance = round(distance,1)
  14. print("distance travelled by the vehicle is %%%% miles)

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.