seed: curriculum content

This commit is contained in:
2026-05-07 14:32:44 +00:00
parent 9258534803
commit ec76f4f56b
100 changed files with 2846 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
---
type: challenge
title: "The Translator"
xp: 50
duration: 25
difficulty: 2
---
# The Translator
> **[INCOMING — Mission Control, Earth]**
>
> Cadet, when input comes in as text (a `str`), you can't do math
> with it directly. You have to *translate* it to a number.
>
> Three converters:
>
> - `int("42")` → `42`
> - `float("3.14")` → `3.14`
> - `str(42)` → `"42"`
>
> Implement `years_until(age)` that returns `100 - age` as an `int`.
> The argument may arrive as either `int` or `str` — handle both
> by calling `int()` on it first.
>
> [END TRANSMISSION]
## Your Task
Open `starter/starter.py`. Convert `age` with `int()`, then return
`100 - age`.
## Objectives
- `years_until(25)` returns `75`
- `years_until("25")` also returns `75` (handles string input)
- Works for any integer age 0100