Chapter Exercise

2.7. Chapter Exercise#

Apply the key ideas from this chapter in the connected task below. Work in your own notebook or local project. Keep your implementation, reasoning, and verification results together.

2.7.1. Build a small Python analysis#

  1. Reuse a short list of records or values from this chapter. Write a function that uses variables, conversion, decisions, and iteration to compute a labeled result.

  2. Use lists, strings, and a dictionary for distinct roles, documenting each function’s parameters and return value.

  3. Check an empty list, repeated categories, and a boundary value. Trace one record through the calculation and verify the report against a manual calculation before interpreting it.

Return to the chapter lessons as needed: Python Syntax, Control Structures, Lists, Strings, Dictionaries, Functions.