Programming Examples

Python program to convert the distance in feet to inches yards and miles


Program to convert the distance (in feet) to inches, yards,  and miles

Solution

dis_ft=int(input("Input distance in feet :"))
dis_inches=dis_ft*12
dis_yards=dis_ft/3.0
dis_miles=dis_ft/5280.0
print(" The distance in inches is %i inches." % dis_inches)
print("The distance in inches in yards is %.2f yards." % dis_yards)
print("The distance in miles is %.2f miles." %dis_miles)
Output/ Explanation:

Input distance in feet :200

 The distance in inches is 2400 inches.

The distance in inches in yards is 66.67 yards.

The distance in miles is 0.04 miles.

Latest Current Affairs 2024 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad