Advanced · 4 labs
Learn if/else one step at a time. Start with a simple unlock check, then build up to the routing rules Sythra uses for streaks, recommendations, and AI tutor access.
Total labs
4
Completed
0
Remaining
4
Progress
0%
In this track
0 / 4 done
Some Sythra labs stay locked until you earn enough XP. Write a function called `is_lab_unlocked(student_xp, required_xp)`. **Rules** - If `student_xp` is greater than or equal to `required_xp`, return `"unlocked"` - Otherwise, return `"locked"` **Examples** - `is_lab_unlocked(150, 100)` → `"unlocked"` - `is_lab_unlocked(40, 100)` → `"locked"` This is a plain `if` / `else` — just two paths.
Not started · 0%
When you open Sythra, your home screen shows a streak message based on how many days in a row you've studied. Write `streak_banner(streak_days)`. **Rules** (check them in this order) 1. `streak_days == 0` → `"Start your streak on Sythra today!"` 2. `streak_days >= 7` → `"Week warrior — keep the flame alive!"` 3. `streak_days >= 3` → `"Nice streak — don't break the chain."` 4. Anything else → `"Day {streak_days} on Sythra."` (use an f-string) **Examples** - `streak_banner(0)` → start message - `streak_banner(7)` → week warrior message - `streak_banner(2)` → `"Day 2 on Sythra."` Now you're chaining `if`, `elif`, and `else`.
Not started · 0%
Sythra suggests what you should do next based on your XP and how many labs you've finished. Write `recommend_next_step(xp, completed_labs)`. **Rules** (first match wins — go top to bottom) 1. No labs done yet → `"lab:python-basics"` 2. At least 500 XP **and** at least 3 labs done → `"project:starter-ml"` 3. At least 200 XP → `"lab:control-flow"` 4. Everything else → `"topic:continue-course"` **Examples** - `recommend_next_step(0, 0)` → `"lab:python-basics"` - `recommend_next_step(250, 1)` → `"lab:control-flow"` - `recommend_next_step(600, 3)` → `"project:starter-ml"` **Tip:** A student with 0 labs should always get Python basics — even if they already have bonus XP.
Not started · 0%
During lessons, Sythra's AI tutor helps explain concepts. Free learners have a daily message limit; premium learners do not. Write `agent_access(daily_used, daily_limit, is_premium)`. **Rules** (check in this order) 1. Premium user → `"granted_unlimited"` 2. Already used the full limit → `"denied_limit_reached"` 3. Exactly one message left → `"granted_last_call"` 4. Otherwise → `"granted"` **Examples** - `agent_access(2, 5, False)` → `"granted"` - `agent_access(4, 5, False)` → `"granted_last_call"` (one left) - `agent_access(5, 5, False)` → `"denied_limit_reached"` - `agent_access(99, 5, True)` → `"granted_unlimited"` This combines a boolean check, comparisons, and a tricky edge case — the hardest step in the track.
Not started · 0%