Skip to main content

Chapter 48 Quiz

Before taking the quiz, verify that you can do each of these without looking at the lessons:

  • Write f-strings: Format variables and expressions inside {} with specifiers like :.1f
  • Index and slice: Get s[0], s[-1], s[1:4] and explain why slicing never raises IndexError
  • Call string methods: Use .strip(), .upper(), .split(), .replace(), .find() and know they return new strings
  • Write collection types: Declare list[str], dict[str, int], tuple[float, float], set[str]
  • Access collections safely: Use indexing for lists, key lookup for dicts, and .get() for missing keys

If any feel uncertain, revisit the specific lesson before continuing.

Test your understanding of strings, collections, and type safety by solving real-world scenarios.

Checking access...