Lab 2.04 - Game Show
1) Follow the flow of execution in the following programs and predict what will happen for each one:
a = 100
difficulty_level= 7
if a > 85 and b > 7:
print("Stellar Grade")
elif a <= 85 and b <= 7:
print("okay grade")
else:
print("pretty good grade")
a = input("What... is your quest")
b = "to seek the holy grail"
if a != b:
print("Go On. Off you go")
else:
b = input("What...is the air-speed velocity of an unladen swallow?")
if b == "What do you mean? An African or European swallow?":
print("I don't know that...AHHH [Bridgekeeper was thrown over bridge]")
else:
print("[you were thrown over bridge]")
user_input = input("What is your favorite color"):
if user_input == 'blue':
print("Blueskadoo")
elif user_input == "red":
print("Roses are red!")
elif user_input == "yellow":
print("Mellow Yellow")
elif user_input == "green":
print("Green Machine")
elif user_input == "orange":
print("Orange you glad I didn't say banana.")
elif user_input == "black":
print("I see a red door and I want it painted black")
elif user_input == "purple":
print("And we'll never be royalllssss")
elif user_input == "pink":
print("Pinky- and the Brain")
else:
print("I don't recognize that color. Is it even...??")
2) Translate this Snap! program into a Python program.
3) Create a game show program!
- Declare 10 prizes (prize1, prize2, prize 3 at the top of your file)
- User picks a number
- The prize corresponding with that door is printed for the user.
Bonus!
Research lists in Python. Re-implement problem 3 using lists.