Articles

Python program to convert kilometers per hour to meters per second

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

You can check our video tutorial on program to convert kilometers per hour to meters per second 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

Few important tips about this program

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:

kmph to mps in python program

This wraps up our session on program to convert kilometers per hour to meters per second in Python.


Python Conversion Programs

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

About the Author
Devjeet Roy
Full Stack Web Developer & Blockchain Enthusiast
Page Views :    Published Date : Nov 27,2022  
Please Share this page

Related Articles

Like every other website we use cookies. By using our site you acknowledge that you have read and understand our Cookie Policy, Privacy Policy, and our Terms of Service. Learn more Got it!