-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patho1.py
More file actions
25 lines (21 loc) · 780 Bytes
/
o1.py
File metadata and controls
25 lines (21 loc) · 780 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
#class Instructor:
# pass
#instructor_1=Instructor()
#instructor_1.name="DEEPAK"
#instructor_1.address="CKM"
#print(instructor_1.name)
#print(instructor_1.address)
#THIS METHOD IS DIFICULT AND THATS why we are using a init function to implement the repeted name and address
# thats why we are creating a init function....
class Instructor:
def __init__(self,instructor_name,address):
self.name=instructor_name
self.address=address
self.followers=0
instructor_1=Instructor("deepak","ckm")
print(instructor_1.name)
print(instructor_1.followers)
instructor_2=Instructor("guru","hassan")
print(instructor_2.name)
print(instructor_2.address)
# BY Using a init function it first declare the comman thinks in the instructor