-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOOP2.py
37 lines (27 loc) · 790 Bytes
/
OOP2.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
29
30
31
32
33
34
35
36
37
class Numbers:
def __init__(self):
self.size = 0
self.Arr = list()
def Accept(self):
print("How many element you want to store? ")
self.size = int(input())
print("Please Enter the elements : ")
for i in range(0,self.size):
value = int(input())
self.Arr.append(value)
def Display(self):
print("Element of list are : ")
for i in range(0,self.size):
print(self.Arr[i])
def Addition(self):
sum = 0
for i in self.Arr:
sum = sum + i
print("sum of list of element is : ",sum)
def main():
obj = Numbers()
obj.Accept()
obj.Display()
obj.Addition()
if __name__ == "__main__":
main()