CPSC 203, 2025 W1
September 25, 2025
You should be registered for EX2 next week.
Post on Piazza if you still need help w machine setup!
A __________ is a collection of ___________. Every ________ is a collection of __________.
We declare a flower: fl1 = Flower(_____,_____,_____)
What data should a Flower store?
We declare a flower: fl1 = Flower(_____,_____,_____)
SPECIES = {"rose", "sunflower", "violet", "daisy"}
THEMES: Dict[str, Dict[str, Color]] = {
"berry": {"fill": (214, 76, 118), "border": (128, 33, 65)},
"sun": {"fill": (247, 181, 0), "border": (168, 123, 0)},
"leaf": {"fill": ( 58, 142, 88), "border": ( 33, 91, 55)},
"ocean": {"fill": ( 84, 156, 241), "border": ( 35, 87, 170)},
}Span:
fl.daisy(pos,span,theme), for example.https://us.prairielearn.com/pl/course_instance/193300/assessment/2591474
15:00
If you finish early, draw more flowers!
We declare a row: row1 = Row(_____,_____,_____)
What data should a Row store?
Given a list of flowers, and a gap:
[f1, f2, f3], gap = 2
Draw the row:
Puzzle: How do you know where to draw each flower?
https://us.prairielearn.com/pl/course_instance/193300/assessment/2591474
15:00
If you finish early, draw more rows!
We declare a garden: g1 = Garden(_____)
What data should a Garden store?
What functionality should a Garden have?
https://us.prairielearn.com/pl/course_instance/193300/assessment/2591474
15:00
If you finish early, make your garden fancy!
Increased fluency in Python from navigating existing code.
You know that a dataclass is a collection of data and functionality, and you have created a few.
Via examples, you are beginning to understand how to decide upon ownership of application data.