-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patho3self__init_().py
More file actions
56 lines (37 loc) · 961 Bytes
/
o3self__init_().py
File metadata and controls
56 lines (37 loc) · 961 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
50
51
52
53
54
55
56
class employee:
fname = "hassan"
def displsy(self):
return f"name ->{mahadi.name}\nfname ->{mahadi.fname}\nage->{mahadi.age}"
mahadi = employee()
mahadi.fname = "nour"
mahadi.name = "mahadi"
mahadi.age = 30
mahadi.displsy()
print(mahadi.displsy())
print("++++++++++++++")
#s->agument variable
#name, age, role ->instance
"""CONSTRACTOR"""
class student:
def __init__(self, Sname, Sage, Srole):
self.name = Sname
self.age = Sage
self.role = Srole
def show(self):
return f"name ->{st.name}\nage ->{st.age}\nrole ->{st.role}"
def show1(self):
print("hi")
print(self.role)
print(self.age)
print(self.show())
n = input("name")
a = int(input("age "))
r = input("role")
st = student(n, a, r)
st.show()
print(st.show())
""" __self__"""
class SELF:
pass
if __name__ == '__main__':
obj = SELF()