Answer to Question #325937 in Python for zayne

Question #325937

1. Write a program that asks the user for a height in inches and prints out how many feet and inches that is. There are 12 inches in one foot. For instance, 40 inches is 3 feet and 4 inches. [Hint: use the // operator and the % operator to get each part.]   


1
Expert's answer
2022-04-08T07:57:57-0400
inches = int(input("height in inches: "))
print(f"{inches//12} feet and {inches%12} inches")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS