PY
py
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
#Learning_From_Telusko_Channel
#https://www.youtube.com/watch?v=b7JzgybKvys&list=PLsyeobzWxl7poL9JTVyndKe62ieoN-MZ3&index=58
class Students:
def __init__(self,name,roll_no):
self.name = name
self.roll_no = roll_no
self.lap = self.Laptop()
def show(self):
print(self.name , self.roll_no)
self.lap.show()
class Laptop:
def __init__(self):
self.brand = "hp"
self.cpu = "i5"
self.ram = 8
def show(self):
print(self.brand,self.cpu,self.ram)
s1 = Students("Mani",5)
s2 = Students("Nana",8)
print(s1.show())
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run