Python Fundamentals — Free Sample

A 5-question sample covering Python data structures, function semantics, list comprehension syntax, language guarantees, and generators. Items focus on conceptual understanding rather than code-tracing — that's reserved for the full 50-question assessment. For a verified Skills Passport credential, take the full assessment.

1. What's the result of multiplying a list by an integer in Python — for example, `[1, 2] * 3`?
2. When is a mutable default argument (like `def f(items=[]):`) evaluated in Python?
3. Which expression is a valid Python list comprehension that produces `[0, 4, 16]` from `range(5)`?
4. In Python 3.7 and later, dictionaries maintain...
5. What does the `yield` keyword do inside a Python function?