- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoop.py
More file actions
Latest commit
28 lines (22 loc) · 473 Bytes
/
Copy pathoop.py
File metadata and controls
28 lines (22 loc) · 473 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
classMyClass(object):
__slots__= ["a"]
def__init__(self, val):
self.a=val
def__str__(self):
return"This is MyClass"
defincrement_a(self, val):
self.a+=val
@staticmethod
defclass_level_method(rachana):
returnrachana
if__name__=="__main__":
myobject=MyClass(5)
printmyobject
myobject.increment_a(5)
printmyobject.a
myobject.b=5
printmyobject.b
print"%s"%"="*10
myobject1=MyClass(5)
printmyobject1.a
printmyobject1.b