**** CREATE A PROGRAM USING PYTHON **** You have two apple trees in your backyar
ID: 3605469 • Letter: #
Question
**** CREATE A PROGRAM USING PYTHON ****
You have two apple trees in your backyard. You want to create a program that will display a graph of how many apples your trees have lost in one day. Trees lose apples based on two factors: has the tree turned color yet and is it windy. If it is windy and the tree has turned color then your tree will lose 10 apples every 6 hours. If it is windy and your tree has not turned color, your tree will lose 3 apples every 6 hours. If it is not windy and your tree has turned color, your tree will loose 5 apples every 6 hours. Finally if it is not windy and your tree has not turned color, your tree will lose 1 apple per 6 hours.
Your program, therefore, needs to ask the user if it is windy and if your two trees have turned color. The output for the program will be the display of a graph.
Your output should look similar to this:
Explanation / Answer
windy = input("Is it windy today (yes/no):")
turn1 = input("Has your first tree turned color yet (yes/no):")
turn2 = input("Has your second tree turned color yet (yes/no):")
print("Tree1 | Tree2")
if windy == "yes":
for i in range(4):
if turn1 == "yes":
for j in range(10):
print("*",end='')
else:
for j in range(3):
print("*",end='')
print("|",end='')
if turn2 == "yes":
for j in range(10):
print("*",end='')
else:
for j in range(3):
print("*",end='')
print("")
else:
for i in range(4):
if turn1 == "no":
print("*|",end='')
else:
for j in range(5):
print("*",end='')
print("|",end='')
if turn2 == "no":
print("*",end='')
else:
for j in range(5):
print("*",end='')
print("")
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.