Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion choose_your_own_adventure.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
elif answer == "cross":
answer = input(
"You cross the bridge and meet a stranger. Do you talk to them (yes/no)? ")

else:
print("You died because you choose a thing out of option!")
Comment on lines +27 to +28

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
python -m py_compile choose_your_own_adventure.py

Repository: techwithtim/5-Python-Projects-For-Beginners

Length of output: 275


🏁 Script executed:

#!/bin/bash
set -euo pipefail
sed -n '1,70p' choose_your_own_adventure.py

Repository: techwithtim/5-Python-Projects-For-Beginners

Length of output: 1722


Replace the second bridge fallback instead of adding a new else.

The else at line 27 closes the bridge-choice conditional before the stranger-response branch, leaving the later bridge fallback unmatched and raising a SyntaxError. Move the death message into the existing bridge fallback and keep the "cross" branch active.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@choose_your_own_adventure.py` around lines 27 - 28, Replace the bridge-choice
conditional’s existing fallback with the death message instead of adding a
separate else branch. Keep the "cross" branch active and ensure the
stranger-response conditional remains properly nested and syntactically valid.

if answer == "yes":
print("You talk to the stanger and they give you gold. You WIN!")
elif answer == "no":
Expand Down