# Program to ask distance in miles and convert into kilometer
"""
In this program, we have to calculate the kilometer when miles is given
We have the formula,
kilometer = miles/0.62
To calculate this we have to ask the distance in miles
"""
m = float(input('enter the distance in miles'));
kilometer = m/0.62
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=12.4
kilometer = m/0.62
print("Distance in kilometer is", kilometer)
10.Write a program in python to ask distance in miles and convert into kilometer
Related Posts
46. Write a program in java to convert decimal number to octal number.(Java, Python, JavaScript, QBasic, C, Go, c++, C#, R)
Algorithm: Step 1: Start Step 2: input Decimal Number(D) Step 3: While D < > 0 If True…
34. Write a program to display perimeter of square.(Java, Python, JavaScript, QBasic, C, Go, c++, C#, R)
Algorithm: Step 1: Start Step 2: Input length of square(l) Step 3: p = 4 * l Step…
31. Write a program to display total surface area and volume of cube.(Java, Python, JavaScript, QBasic, C, Go, c++, C#, R)
Algorithm: Step 1: Start Step 2: Input Length. (L) Step 3: A = 6 * L ^ 2…