-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInheritance_Example8.py
More file actions
29 lines (22 loc) · 1.05 KB
/
Inheritance_Example8.py
File metadata and controls
29 lines (22 loc) · 1.05 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
class ElectronicDevice:
def __init__(self,switch,in_built_stabiliser):
self.switch = switch
self.in_built_stabilizer = in_built_stabiliser
class Computer(ElectronicDevice):
def __init__(self,switch,in_built_stabiliser,screen_type):
ElectronicDevice.__init__(self,switch,in_built_stabiliser)
self.screen_type = screen_type
class TV(ElectronicDevice):
def __init__(self,switch,in_built_stabilizer,mode_of_input):
super().__init__(switch,in_built_stabilizer)
self.mode_of_input =mode_of_input
class Laptop(Computer):
def __init__(self,switch,in_built_stabilizer,screen_type,laptop_brand):
Computer.__init__(self,switch,in_built_stabilizer,screen_type)
self.laptop_brand = laptop_brand
class Desktop(Computer):
def __init__(self,switch,in_built_stabilizer,screen_type,mother_board_type):
Computer.__init__(self,switch,in_built_stabilizer,screen_type)
self.mother_board_type = mother_board_type
d1=Desktop("Indian","yes","OLED","NVIDIA")
l1=Laptop("USA","No","LED","AMD")