17.9k views
3 votes
2.3 Code Practice: Question 2 Write a program that inputs the length of two pieces of fabric in feet and inches (as whole numbers) and prints the total.

User ThanhHH
by
6.2k points

1 Answer

3 votes

Answer:

ft1= int(input("Enter the Feet: "))

in1= int(input("Enter the Inches: "))

ft2= int(input("Enter the Feet: "))

in2= int(input("Enter the Inches: "))

totalft= ft1 + ft2 + int((in1+in2)/12)

totalin= (in1+in2) % 12

print("Feet: " + str(totalft) + " Inches: " + str(totalin))

User Dehan Wjiesekara
by
6.0k points