- # Define the starting point (point A) and destination (point B)
- point_a = (0, 0)
- point_b = (100, 200)
- # Define the speed of the car in miles per hour
- speed = 50
- # Calculate the distance between point A and point B
- distance = ((point_b[0] - point_a[0]) ** 2 + (point_b[1] - point_a[1]) ** 2) ** 0.5
- # Calculate the time it will take the car to travel from point A to point B
- time = distance / speed
- # Print the time it will take the car to travel from point A to point B
- print("The car will take {:.2f} hours to travel from point A to point B.".format(time))
[text] car travelling from pint A to point B
Viewer
Editor
You can edit this paste and save as new:
File Description
- car travelling from pint A to point B
- Paste Code
- 23 Mar-2023
- 577 Bytes
You can Share it:
Latest Code Pastes