Practice: Python Application Development

« Read the chapter

Q21. print versus logging

IntermediateConceptual

Give two reasons to prefer logging over print for diagnostic messages.

Goal: Compare tools.

Q22. Virtual environment

IntermediateConceptual

What problem does a virtual environment solve?

Goal: Manage dependencies.

Q23. Task summary

IntermediateApplication

Given a list of dictionaries with keys title and done, print how many tasks are done and how many are not, as done=2 todo=1.

Goal: Summarise stored data.

Q24. Safe config loader

AdvancedApplication

Write load_config(text) that returns json.loads(text), or an empty dict if the text is not valid JSON. Print the results for '{"a": 1}' and 'oops'.

Goal: Handle errors safely.

Q25. Word counter app

AdvancedApplication

Write count_words(text) returning a dict of lower-case word counts sorted by word, and print it for 'Go go stop'.

Goal: Build testable logic.