01 / Specify
Known drinks only; whole positive quantities; prices in cents; unknown or invalid orders receive a clear message.
Enter all answers here before running. Input is not echoed; prompts appear in the output. Missing lines produce EOFError. Reset restores the example inputs.
Ctrl / ⌘ + Enter to run. Tab inserts four spaces; Esc leaves the editor. Each run starts with fresh Python variables.
This is the output of the unchanged starter. Your edits may intentionally produce different results.
Practice marks are your own checklist, saved on this device. They do not grade your code. Code and prepared input are not saved with the marks.
Python loads on your first run (about 14 MB). Execution stays in this browser tab and resets after 10 seconds. Standard-library exercises; input() reads the prepared input box. Files are temporary browser files in a fresh folder per run. Extra package installation is not supported here. Work is not saved after closing or reloading this page. Download your code to keep it.
Garen, Ashe and Lux are used as a fan-made educational reference to League of Legends. All numbers and formulas are invented for this exercise; no live game data or artwork is used. This studio is not affiliated with Riot Games.
Combine the ideas in your own version. The lab runs each example independently; combine the required pieces explicitly instead of relying on variables or files from earlier runs.
Known drinks only; whole positive quantities; prices in cents; unknown or invalid orders receive a clear message.
Start from the receipt example. Extract a calculation function, add validation, then save and reload the order as CSV or JSON.
Check two lattes plus one tea total 1200 cents, an empty order totals zero, and invalid quantities are rejected. Explain why each check exists.
In one-to-one online sessions, we can review your trace, debugging decisions and explanation, then choose the next exercise. These are studio-authored examples; UOW’s public subject descriptions inform topic coverage, not university affiliation or official assessment preparation.
The same cafe story connects requirements, responsibilities and Python objects. The class starter is deliberately small; quantity validation is a follow-up exercise.
Name the drinks, prices, quantities and output. Decide how an empty order and an invalid quantity should behave before choosing classes.
MenuItem owns its name and unit price. Order owns its lines and total. An order contains menu items through composition, rather than inheriting from an item.
Run “Model a cafe order”. Create separate orders, inspect their state and add validation. Check two lattes total 900 cents and an empty order totals zero.
name · price_centslines[] · add(item, quantity)
total_cents()self refers to an instance. Each Order creates its own lines list in __init__; a mutable class-level list would be shared across orders. The optional hero example explores inheritance separately.
Begin with your own analysis. Ask an AI tool to question assumptions, critique responsibilities or propose edge cases. Check each suggestion against the brief and the running code, then explain what you accepted and why.
“Review this design without rewriting it. Identify one unclear responsibility and two edge cases. Ask me to clarify missing requirements before suggesting changes.”
This is a prompt you can use with your own AI tool. The lab does not call an AI service.
Extension: add quantity validation to Order.add(), test an empty order and explain which class owns each rule.