Sythra
All tracks

Advanced · 4 labs

Sythra Leaderboard Lab: Loop Tools

Use break, continue, enumerate, range, and zip on leaderboard and lab lists — loop patterns Sythra uses in the UI.

Total labs

4

Completed

0

Remaining

4

Progress

0%

In this track

Labs

0 / 4 done

Lab 01Easy

First Locked Lab

The labs page shows the first lab that is still locked. Write first_locked_lab(labs). Each lab is a dict with name and unlocked (bool). Scan in order; use break on the first lab where unlocked is False. Return that lab's name, or None if every lab is unlocked. Examples - first locked after two open → name of third - all unlocked → None - empty list → None

Not started · 0%

Start →
Lab 02Easy

Skip Completed

Sythra sums XP only from labs you have not finished yet. Write remaining_xp(labs). Each lab dict has xp (int) and completed (bool). Use continue to skip completed labs. Sum xp from the rest. Examples - one incomplete 40 XP, one complete 100 XP → 40 - all complete → 0 - empty → 0

Not started · 0%

Start →
Lab 03Medium

Ranked Board

Leaderboards show numbered rows on Sythra. Write two functions: 1. ranked_board(names) → ["1. Asha", "2. Ravi", ...] using enumerate(names, start=1) 2. top_n(names, n) → first n names using range (not slicing alone for the loop) Empty names → [] for both. If n is larger than len(names), top_n returns all names in order. Examples - ranked_board(["Asha", "Ravi"]) → ["1. Asha", "2. Ravi"] - top_n(["A", "B", "C"], 2) → ["A", "B"] - top_n([], 3) → []

Not started · 0%

Start →
Lab 04Hard

Name and Score Pairs

Sythra renders score lines and finds tied learners. Write: 1. pair_scores(names, scores) → ["Asha: 90", "Ravi: 85"] using zip (stops at shorter list) 2. tied_pairs(names, scores) → list of tuples (name_a, name_b) for every pair with equal scores, using nested loops For ties: only i < j (first name before second in the list). No duplicate pairs or reversed duplicates. Examples - pair_scores(["Asha"], [90]) → ["Asha: 90"] - tied_pairs with Asha and Ravi both 90 → ("Asha", "Ravi") once - three-way tie at 90 among A, B, C → (A,B), (A,C), (B,C) in index order

Not started · 0%

Start →