Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python basic programs kilometers to miles

# Taking kilometers input from the user
kilometers = float(input("Enter value in kilometers: "))

# conversion factor
conv_fac = 0.621371

# calculate miles
miles = kilometers * conv_fac
print('%0.2f kilometers is equal to %0.2f miles' %(kilometers,miles))
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #python #basic #programs #kilometers #miles
ADD COMMENT
Topic
Name
6+9 =