Sythra
All tracks

Advanced · 4 labs

Sythra Toolkit: Functions

Build small Sythra helpers with functions — greetings, XP rewards, daily quests, and streak updates. You are the new engineer at Sythra.

Total labs

4

Completed

0

Remaining

4

Progress

0%

In this track

Labs

0 / 4 done

Lab 01Easy

Greeting Function

Sythra greets every learner when a lesson starts. Write greet_learner(name). Rules - Return "Hi, {name}! Ready to learn?" - If name is empty after stripping spaces, use "there" instead Examples - greet_learner("Asha") → "Hi, Asha! Ready to learn?" - greet_learner("") → "Hi, there! Ready to learn?" - greet_learner(" ") → "Hi, there! Ready to learn?"

Not started · 0%

Start →
Lab 02Easy

XP Reward

Study minutes turn into XP on Sythra using a simple multiplier. Write xp_reward(minutes, multiplier). Rules - Return minutes times multiplier - Must return the number — do not only print it Examples - xp_reward(30, 2) → 60 - xp_reward(0, 5) → 0 - xp_reward(15, 1) → 15

Not started · 0%

Start →
Lab 03Medium

Daily Quest Picker

Sythra picks a daily quest and estimates how many quests you need for a goal. Write two functions: 1. pick_daily_quest(quests, seed=0) — use random.Random(seed).choice 2. quests_needed(goal_xp, xp_per_quest) — use math.ceil; goal 0 → 0; xp_per_quest 0 → 0 Examples - pick_daily_quest(["A", "B", "C"], seed=1) is stable for that seed - quests_needed(100, 40) → 3 - quests_needed(80, 40) → 2 - quests_needed(0, 40) → 0

Not started · 0%

Start →
Lab 04Hard

Streak Engine

Sythra updates streaks from day numbers (integers), not calendar dates. Write: 1. is_consecutive(last_day, today) → True only when today is exactly last_day + 1 2. update_streak(streak, last_day, today) → (new_streak, status) - same day → (streak, "same day") - consecutive → (streak + 1, "continued") - otherwise → (1, "reset") update_streak must call is_consecutive. Do not use global variables. Examples - update_streak(3, 10, 10) → (3, "same day") - update_streak(3, 10, 11) → (4, "continued") - update_streak(3, 10, 12) → (1, "reset")

Not started · 0%

Start →