-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOOP1.py
More file actions
34 lines (22 loc) · 731 Bytes
/
OOP1.py
File metadata and controls
34 lines (22 loc) · 731 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
class Arithematic:
def __int__(self,A,B):
print("Inside init method")
self.No1 = A
self.No2 = B
def Addition(self):
Ans = self.No1 + self.No2
return Ans
def Substraction(self):
Ans = self.No1 - self.No2
return Ans
def main():
print("Inside main method")
obj = Arithematic (11,10)
Output = obj.Addition()
print("Addition is: ",Output)
Output = obj.Substraction()
print("Substraction is: ",Output)
objX = Arithematic(21,20)
if __name__ == "__main__":
print("Inside Starter")
main()