blob: 08630707a61e610a50feef4a8d0fcd0df573bbe2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import dataclasses
@dataclasses.dataclass
class Worm:
name: str
type: str
color: str
class Fruit:
def __init__(self):
self.name = "Little Apple"
self.color = "Bright red"
self.vitamins = ["A", "B1"]
self.antioxidants = None
self.worms = [
Worm(name="Jimmy", type="Codling Moths", color="light brown"),
Worm(name="Kim", type="Apple maggot", color="Whitish"),
]
|