Tech Study

Write a Python program to convert the distance (in feet) to inches, yards, and miles

Introduction

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

Write a Python program to convert the distance (in feet) to inches, yards, and miles
Write a Python program to convert the distance (in feet) to inches, yards, and miles

Taggedand milesWrite a Python program to convert the distance (in feet) to inchesyards

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more