HOME/Articles/

speed calc (snippet)

Article Outline

Python example 'speed calc'. This program calculates the speed, given time and distance.

speed calc

Python beginners example: speed calc

print('##################################################################### SPEED CALCULATOR ######################################################################################')
print('Simple program to calculate speed with given distance and time')
distance=int(input('Enter the distance in km : '))
time=int(input('Enter the time seconds : '))
speed=distance/time
print('The speed in m/s is : ',speed)