code:-
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)
output:-
Input distance in feet: 12
The distance in inches is 144 inches.
The distance in yards is 4.00 yards.
The distance in miles is 0.00 miles.
The distance in inches is 144 inches.
The distance in yards is 4.00 yards.
The distance in miles is 0.00 miles.
Post a Comment
If you have any doubts, Please let me know
Thanks!