134k views
2 votes
Write a program that inputs the length of two of pieces of wood in yards and feet (as whole numbers) and prints the total.

IN PYTHON ONLY

Write a program that inputs the length of two of pieces of wood in yards and feet-example-1
User Notmystyle
by
3.5k points

1 Answer

4 votes

Answer:

yards = int(input("Enter the Yards: "))

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

yards2 = int(input("Enter the Yards: "))

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

totalYards = yards + yards2

totalFeet = feet + feet2

if totalFeet >= 3:

totalYards += 1

totalFeet -= 3

print("Yards:", totalYards, "Feet:", totalFeet)

else:

print("Yards:", totalYards, "Feet:", totalFeet)

User Rakeshdas
by
3.5k points