-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOOPS9.py
More file actions
49 lines (40 loc) · 923 Bytes
/
OOPS9.py
File metadata and controls
49 lines (40 loc) · 923 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
44
45
46
47
48
49
# class Dad:
# basketball=1
#
#
# class Son(Dad):
# dance=1
# def isdance(self):
# return f"Yes I dance {self.dance} number of times"
#
# class Grandson(Son):
#
#
# dance=6
#
# def isdance(self):
#
# return f"Dancer " \
# f"Yes I dance ballet {self.dance} no of times"
#
#
#
# kane=Dad()
# debruyne=Son()
# Ansh=Grandson()
#
# print(Ansh.basketball)
class Electronic_Device:
Quantity =100
class Pocket_gadgets(Electronic_Device):
Carriable_Rating=8
def Rating(self):
return f"I am rated as {self.Carriable_Rating}/10 as the most carried device"
class phone(Pocket_gadgets):
def Rating(self):
return f"I am a phone and"\
f"have the most {self.Carriable_Rating} rating as the most carried item"
nokia=Electronic_Device()
samsung=Pocket_gadgets()
HP=phone()
print(HP.Rating())