-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCar.py
More file actions
43 lines (28 loc) · 860 Bytes
/
Car.py
File metadata and controls
43 lines (28 loc) · 860 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
33
34
35
36
37
38
39
40
41
42
43
class Car:
#Properties
color = ""
brand = ""
number_of_wleels = 4
number_of_seate = 4
maxspeed = 0
#Constructor
def __init__(self, color, brand, number_of_wleels, number_of_seate, maxspeed):
self.color = color
self.brand = brand
self.number_of_seate = number_of_seate
self.number_of_wleels = number_of_wleels
self.maxspeed = maxspeed
#Create metthod set coler
def setcoler(self, x):
self.color = x
def setbrand(self, x):
self.brand = x
def setspeed(self, x):
self.maxspeed = x
def printdata(self):
print("Color of this car is", self.color)
print("Brand of this car is", self.brand)
print("Max speed of this car is", self.maxspeed)
#deconstructor
def __del__(self):
print()