12 questions to validate Python language basics: variables, conditions, loops, functions and hands-on practice.
Answer everything, then click Check: your score and explanations will appear.
1.1 · Recall
1. What does the input() function always return?
input() ALWAYS returns text: int() or float() before any computation.
1.1 · Application
2. Nabil writes print("I am " + age) with age = 30. What happens?
Strong typing: convert (str(age)) or use an f-string f"I am {age} years old".
1.2 · Recall
3. In Python, what is indentation for?
4 spaces per level; mixing spaces/tabs raises IndentationError.
1.2 · Application
4. Nabil classifies: if age < 12, elif age < 18, elif age < 65, else. Where does a 26-year-old respondent fall?
Evaluation in order, stopping at the first true one: specific→general order guarantees uniqueness.
1.3 · Application
5. Nabil walks through a list of names. Recommended writing?
Plain for is readable and index-error free; enumerate() if the number is used.
1.3 · Recall
6. When should you prefer while over for?
for = what you walk through; while = as long as, with guaranteed exit.
1.4 · Application
7. Nabil's function displays with print but forgets return. What is the call worth?
Only return passes on a storable, computable result.
1.4 · Application
8. Nabil writes def add(x, items=[]) and calls it twice. What happens?
The mutable default is created only once: write def add(x, items=None).
1.2 · Arbitration
9. Two tests overlap and a case falls into the wrong group. Decision?
Order guarantees uniqueness; else catches oversights.
1.3 · Arbitration
10. Nabil's retry while runs forever. Decision?
One variable of the condition must change each round; Ctrl+C unblocks.
1.5 · Application
11. In Nabil's address book, where should the menu loop be?
One verb = one function; main() holds only the menu loop that calls.
1.5 · Arbitration
12. Nabil knows each concept in isolation but freezes facing the blank page. Decision?
Decomposition beats the blank page; one finished project alone proves the foundation.
What's next?
Score ≥ 80%: move to Level 2 V3 (collections, strings, files and objects — handling structured data and keeping it).
Score between 50% and 80%: revisit the failed sections (conversions in 1.1, indentation in 1.2, for/while in 1.3, return and defaults in 1.4, splitting in 1.5), re-read the explanations above, then retake the test.
Score < 50%: restart the level running each template locally — the 1.5 address book is the judge: code it alone before moving on.