Write a program that inputs the length of two pieces of fabric in feet and inches (as whole numbers) and prints the total.
#Getting inputs from the User
feet_1= int(input("Enter the first length in feet: "))
inche_1 = int(input("Enter the first length in inches "))
feet_2 = int(input("Enter the second length in feet: "))
inche_2 = int(input("Enter the second length in inches "))
# Calculations
inches = inche_1 + inche_2
inc_to_ft = inches // 12
rem_from_div = inches % 12
sum_ft = a_ft + b_ft + inc_to_ft
#Printing the final result
print("Feet: {} Inches: {}".format(sum_ft, rem_from_div))
Comments
Leave a comment