Articles

# Python program to convert kilometers per hour to meters per second

In this python programming guide, we are going to learn

• program to convert km/hr to m/s in python

### Program to convert Kilometers per hour to Meters per second in Python

The program to convert Kmph to Mps in Python is as follows:

``````# Owner : TutorialsInhand Author : Devjeet Roy

kmph= float(input("Enter speed in Km/Hr: "))

mps = (kmph * 1000)/3600
print("The speed in m/s is",round(mps,2))``````

The output of python program to convert km per hour to meter per second is as follows:

``````PS C:\Users\DEVJEET\Desktop\tutorialsInHand> python code.py
Enter speed in Km/Hr: 45
The speed in m/s is 12.5``````

1. We first take user input and convert it to float data type.

2. Then we need to multiply it by 1000/3600 or 5/18 to convert it to m/s.

3. We round off the answer upto 2 decimal places using the round() function in Python.

Snapshot for python program to convert km per hour to meter per second: Python Conversion Programs

Would you like to see your article here on tutorialsinhand. Join Write4Us program by tutorialsinhand.com 