Themadhatter1999

vehiclelib

May 26th, 2023
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. #calculates the distance a given object has traveled given the time and speed
  2. def calcDistance(mph = 0, time = 0):
  3.     result = 0
  4.     result = mph*time
  5.     return result
  6.  
  7. #calculate the speed of a given object uaing the above spees equation and returning that result
  8. def calcSpeed(distance = 0, time = 0):
  9.     result = 0
  10.     result = distance/time
  11.     return result
  12.  
  13. #This will get you the time it will take to cross a given distance at a given speed
  14. def calcTime(distance = 0, speed = 0):
  15.     result = 0
  16.     result = distance/speed
  17.     return result
  18.    
Advertisement
Add Comment
Please, Sign In to add comment