Sythra
All tracks

Advanced · 4 labs

Sythra Topic Tree: Recursion

Walk topic trees, XP lists, and nested curricula with recursion — how Sythra orders lessons behind the scenes. Every lab must use a recursive solution (no for or while in your function).

Total labs

4

Completed

0

Remaining

4

Progress

0%

In this track

Labs

0 / 4 done

Lab 01Easy

Countdown to Streak Reset

Before a streak resets, Sythra shows a countdown from n down to 0. Write countdown(n). Return a list [n, n-1, ..., 0] using recursion only (no for or while loops in countdown). Examples - countdown(3) → [3, 2, 1, 0] - countdown(0) → [0] - countdown(1) → [1, 0]

Not started · 0%

Start →
Lab 02Easy

Sum of Lesson XP

Sythra totals XP from a list of lesson rewards recursively. Write sum_lesson_xp(xps). Add all integers in xps using recursion only. Empty list → 0. Examples - sum_lesson_xp([10, 20, 30]) → 60 - sum_lesson_xp([]) → 0 - sum_lesson_xp([5]) → 5

Not started · 0%

Start →
Lab 03Medium

Prerequisite Chain

Topics unlock in order on Sythra. prereqs maps each topic to its prerequisite topic, or None if there is none. Write prerequisite_chain(topic, prereqs). Return the learning order as a list ending at topic — prerequisites first. Example: prereqs = {"B": "A", "C": "B"} and topic "C" → ["A", "B", "C"] Use recursion only in prerequisite_chain. Examples - topic with no entry in prereqs → [topic] - three-deep chain as above - single topic "Loops" with empty prereqs → ["Loops"]

Not started · 0%

Start →
Lab 04Hard

Nested Curriculum Counter

Course catalogs nest modules inside modules on Sythra. Write count_lessons(curriculum). curriculum is a nested list: each item is either a lesson name (str) or a sublist of more items. Count only string lessons (not sublists themselves). Use recursion only. Examples - count_lessons(["A", "B"]) → 2 - count_lessons(["A", ["B", "C"], "D"]) → 4 - count_lessons([]) → 0 - count_lessons([[]]) → 0

Not started · 0%

Start →