Python program to convert miles to kilometers
In this example, we will learn how to convert Miles to kilometers.
miles=float(input(‘ Enter any number in miles: ‘))
# 1miles=1.60934 km
kilometers = miles * 1.60934
print(‘{0} miles is equal to {1} kilometers’.format(miles,kilometers) )
Output
Enter any number in miles: 2
2.0 miles is equal to 3.21868 kilometers
Python program to convert kilometers to miles
In this example, we will learn how to convert kilometers to Miles.
kilometers = float(input(‘ Enter any number in kilometers: ‘))
# 1km= 0.621 miles
miles = kilometers * 0.621
print(‘{0} kilometers is equal to {1} miles’.format(kilometers,miles) )
Output
Enter any number in kilometers: 3
3.0 kilometers is equal to 1.863 miles
You can find more example below
Python Program to add two numbers
Python program to find Area of Square
Python program to find Area of Triangle
Python program to swap two variables
Python program to convert Celsius to Fahrenheit
Python program to generate Random Number
Python program to convert Miles to Kolometers
Python program to find Largest of 2 numbers
Python program to check if number is Odd or Even
Python program to check if number is Positive Negative or Zero
Python program to check Leap Year
Types of Loop in Python
Python program to check Prime Number
Python program to Calculate Sum of N Natural Numbers
Python program to find sum of All Even Number between 1 to 10
Python program to find sum of All Odd Number between 1 to 10
Python program to check Armstrong Number