256,917 views
18 votes
18 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 Adampasz
by
3.1k points

1 Answer

13 votes
13 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 Jaskier
by
2.8k points