Practice: Python Application Development
Q21. print versus logging
Give two reasons to prefer logging over print for diagnostic messages.
Goal: Compare tools.
Q22. Virtual environment
What problem does a virtual environment solve?
Goal: Manage dependencies.
Q23. Task summary
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
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
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.