๐Ÿ“‹Dataclass Patterns & field()WORKSHOP
1
2
3
4
5

Step 1

Create a `Book` dataclass with fields: `title` (str), `author` (str), `year` (int), and `rating` (float, default 0.0). Print an instance to verify the auto-generated `__repr__`, and check that two Books with the same data are equal.

โŒ˜ Enter (Mac) ยท Ctrl+Enter (Win/Linux)