Write a Python program to convert the distance (in feet) to inches, yards, and miles
I have used python 3.7 compiler for debugging purpose.
d_ft = int(input("Input distance in feet: ")) d_inches = d_ft * 12 d_yards = d_ft / 3.0 d_miles = d_ft / 5280.0 print("The distance in inches is %i inches." % d_inches) print("The distance in yards is %.2f yards." % d_yards) print("The distance in miles is %.2f miles." % d_miles)
Result:
Input distance in feet: 5
The distance in inches is 60 inches.
The distance in yards is 1.67 yards.
The distance in miles is 0.00 miles.
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
I have used python 3.7 compiler for debugging purpose.
Result:
Input distance in feet: 5
The distance in inches is 60 inches.
The distance in yards is 1.67 yards.
The distance in miles is 0.00 miles.
need an explanation for this answer? contact us directly to get an explanation for this answer