forked from CodeMouse92/DeadSimplePython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake_calzone.py
More file actions
32 lines (24 loc) · 782 Bytes
/
make_calzone.py
File metadata and controls
32 lines (24 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class Food:
def __init__(self, name):
self.name = name
class Pizza(Food):
def __init__(self, toppings, name="Pizza", **kwargs):
super().__init__(name=name, **kwargs)
self.toppings = toppings
class Sandwich(Food):
def __init__(self, bread, fillings, name="Sandwich", **kwargs):
super().__init__(name=name, **kwargs)
self.bread = bread
self.fillings = fillings
class Calzone(Pizza, Sandwich):
def __init__(self, toppings):
super().__init__(
toppings=toppings,
bread='pizza crust',
fillings=toppings,
name='Calzone'
)
# The usage...
pizza = Pizza(toppings="pepperoni")
sandwich = Sandwich(bread="rye", fillings="swiss")
calzone = Calzone("sausage")