# Program to ask distance in meter and convert into kilometer
"""
In this program, we have to calculate the kilometer when meter is given
We have the formula,
kilometer = meter/1000
To calculate this we have to ask the distance in meter
"""
m = float(input('enter the distance in meter'));
kilometer = m/1000
print("Distance in kilometer is", kilometer)
"""
If the values are explicitly given.
Then we do not have to ask the values from the user
"""
m=1200
kilometer = m/1000
print("Distance in kilometer is", kilometer)
11. Write a program in python to input distance in meter and convert into kilometer.
Related Posts
40. Write a program to display cost of painting the four walls of a room.(Java, Python, JavaScript, QBasic, C, Go, c++, C#, R)
Algorithm: Step 1: Start Step 2: Enter length, breadth, height and cost (l, b, h, c) Step 3:…
33. Write a program to display volume of cube.(Java, Python, JavaScript, QBasic, C, Go, c++, C#, R)
Algorithm: Step 1: Start Step 2: Input Length. (L) Step 3: V = L ^ 3 Step 4:…
32. Write a program to display area of triangle.(Java, Python, JavaScript, QBasic, C, Go, c++, C#, R)
Algorithm: Step 1: Start Step 2: Input Breadth and Height. (B, H) Step 3: A = 1/2 *…