-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4-15.py
More file actions
30 lines (21 loc) · 838 Bytes
/
4-15.py
File metadata and controls
30 lines (21 loc) · 838 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
class Transport():
def __init__(self, name, max_speed, mileage):
self.name = name
self.max_speed = max_speed
self.mileage = mileage
x = Transport("KAMAZ", 350, 1000)
print(f'{x.name} skorost: {x.max_speed} probeg: {x.mileage}')
#############################################################
class Transport():
def __init__(self, name, max_speed, mileage):
self.name = name
self.max_speed = max_speed
self.mileage = mileage
def seating_capacity(self, capacity):
return f"vmestimost odnogo avtobusa {self.name} {capacity} passazhirov"
class Autobus(Transport):
capacity = 50
def seating_capacity(self, capacity):
print(f'vmestimost odnogo avtobusa {self.name} {capacity} passazhirov')
x = Autobus('kamaz', 200, 100)
x.seating_capacity(50)