class SimplePuzzleGame:
def __init__(self):
[Link] = {
"I’m tall when I’m young, and I’m short when I’m old. What am I?":
"candle",
"What has to be broken before you can use it?": "egg",
"I’m light as a feather, yet the strongest man can’t hold me for much
longer than a minute. What am I?": "breath",
"What has many keys but can’t open a single lock?": "piano",
}
[Link] = 0
def play(self):
print("Welcome to the Simple Puzzle Game!")
print("Try to solve these easy puzzles!\n")
for question, answer in [Link]():
user_answer = input(f"Puzzle: {question}\nYour answer:
").strip().lower()
if user_answer == answer:
print("Correct!\n")
[Link] += 1
else:
print(f"Wrong! The correct answer was: {answer}\n")
print(f"Game over! Your total score is {[Link]}/{len([Link])}.")
if __name__ == "__main__":
game = SimplePuzzleGame()
[Link]()