-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path143 prog.py
More file actions
47 lines (40 loc) · 834 Bytes
/
Copy path143 prog.py
File metadata and controls
47 lines (40 loc) · 834 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
list1=[]
list2=[]
list3=[]
print("enter name1")
name1=input()
print("enter list1 of marks :")
for i in range(0,3):
a=int(input())
list1.append(a)
print("enter name2")
name2=input()
print("enter list2 of marks :")
for i in range(0,3):
b=int(input())
list2.append(b)
print("enter name3")
name3=input()
print("enter list3 of marks :")
for i in range(0,3):
c=int(input())
list3.append(c)
#print(name,list1)
#print(name2,list2)
#print(name3,list3)
class student:
def __init__(self):
self.n=0
self.l=0
def set(self,n,l):
self.n=n
self.l=l
def __add__(self,other):
return self.l+other.l
obj1=student()
obj1.set(name1,list1)
obj2=student()
obj1.set(name2,list2)
obj4=student()
obj4=obj1+obj2
print(obj4)