Advanced · 4 labs
Format lesson records with tuples, dedupe badges with sets, find missing topics, and match study buddies — the data shapes Sythra uses for progress and social features.
Total labs
4
Completed
0
Remaining
4
Progress
0%
In this track
0 / 4 done
Sythra stores a finished lesson as a tuple of title, XP, and done flag. Write format_record(record). Rules - record is (title, xp, done) where done is True or False - Return "{title}: {xp} XP (done)" when done is True - Return "{title}: {xp} XP (pending)" when done is False Examples - format_record(("Loops", 40, True)) → "Loops: 40 XP (done)" - format_record(("Lists", 30, False)) → "Lists: 30 XP (pending)"
Not started · 0%
Learners earn the same badge twice sometimes. Sythra shows each badge once, sorted alphabetically. Write unique_badges(badges) → list Rules - Remove duplicates using a set - Return a sorted list of unique badge names Examples - unique_badges(["star", "star", "loop"]) → ["loop", "star"] - unique_badges([]) → []
Not started · 0%
Sythra highlights topics you have not finished yet. Write missing_topics(all_topics, done) → list Rules - all_topics and done are lists of topic name strings - Return topics in all_topics that are not in done - Use set difference (or equivalent) - Return the result sorted alphabetically Examples - missing_topics(["A", "B", "C"], ["A"]) → ["B", "C"] - missing_topics(["A"], ["A", "B"]) → [] - missing_topics([], ["A"]) → []
Not started · 0%
Sythra pairs learners who study overlapping topics. Write study_buddy(a, b) where a and b are sets of topic strings. Return a dict with exactly these keys (each value is a sorted list of strings): - shared — topics in both sets - combined — all topics from either set - only_a — topics in a but not in b - only_b — topics in b but not in a Examples - study_buddy({"loops", "lists"}, {"lists", "dicts"}) → shared ["lists"], combined ["dicts", "lists", "loops"], only_a ["loops"], only_b ["dicts"] - study_buddy(set(), {"a"}) → shared [], combined ["a"], only_a [], only_b ["a"]
Not started · 0%