-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
62 lines (51 loc) · 1.15 KB
/
Copy pathmain.py
File metadata and controls
62 lines (51 loc) · 1.15 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
class person:
occupation = "Data scientest"
def person():
print("hello .....")
def info(self):
print(f"{self.name} is a {self.occupation}")
def __init__(self, name, networth):
self.name = name
self.networth = networth
# a = person()
# print(a.name)
# a.info()
# b = person()
# b.name = "Susmita"
# b.occupation = "Nurse"
# b.networth = 20000
# b.info()
c = person("Sudip",100)
c.info()
class car:
def __init__(self):
self.__accelator = False
self.__brk =True
self.clutch = False
def start(self):
self.clutch = True
self.__brk = False
self.__accelator = True
print("car is starting")
c1 = car()
c1.start()
del c
# print(c1.__brk)
class truck():
@staticmethod
def start():
print("truck is starting")
@staticmethod
def stop():
print("truck is stoping")
class tatatruck(truck):
def __init__(self, brand):
self.brand = brand
t1 = tatatruck("razor")
print(t1.brand)
print(t1.start())
class razor(tatatruck):
def __init__(self, type):
self.type = type
r1 = razor("gas")
print(r1.start())