Build a beginner-friendly Python nested condition checker for an adventure game. You'll see how an outside condition controls whether an inside condition runs, then practice with a bonus-door challenge.
⏱ Chapters:
0:00 Intro — Arohas Code Lab
0:03 Two Gates, One Decision Path
0:18 Outer Check Opens Inner Check
0:33 Indentation Shows Which Check Owns Lines
0:49 Three Player States Produce Three Messages
1:04 Nearest Else Can Hide a Locked-Level Path
1:21 Challenge: Write the Bonus-Door Check
#Python #LearnPython #BeginnerPython #CodingTutorial #ArohasCodeLab
Challenge Solution
Entry point:
```python
def can_open_bonus(level_unlocked, has_key):
if level_unlocked:
if has_key:
return "Open bonus door"
return "Find the key first"
return "Unlock the level first"
```
Expected behavior:
`can_open_bonus(True, True)` returns `Open bonus door`
`can_open_bonus(True, False)` returns `Find the key first`
`can_open_bonus(False, True)` returns `Unlock the level first`
Worked example:
```python
print(can_open_bonus(True, True))
print(can_open_bonus(True, False))
print(can_open_bonus(False, True))
```
Output:
```text
Open bonus door
Find the key first
Unlock the level first
```
The level check is the outer condition. The key check is the inner condition, so Python only checks the key after the level is unlocked.
On this page of the site you can watch the video online Python Nested If Statements - Multiple Conditions with a duration of hours minute second in good quality, which was uploaded by the user Arohas Code Lab 29 May 2026, share the link with friends and acquaintances, this video has already been watched No times on youtube and it was liked by 0 viewers. Enjoy your viewing!