+ 1

Write a python program that uses class to store exam number and marks of four subject.Yae list to store the marksof foursubject

https://code.sololearn.com/cbqPqWkk7Q3N/?ref=app

18th May 2020, 2:06 PM
Legends Feelings
Legends Feelings - avatar
3 ответов
+ 3
There some issues, see comments in code: class student: exam_no=int(input("Enter marks")); marks=[] for i in range(exam_no): # should not be hardcoded, use exam_no instead n=int(input("enter marks")) # missing indentation marks.append(n) # write "marks" not "Marks" # missing indentation s=student() print("\nexam no is:",s.exam_no) print("\n4subject marks:",s.marks)
18th May 2020, 2:24 PM
Lothar
Lothar - avatar
+ 3
Legends Feelings, when you mention an error, please tell us in which code the error occurs, and please also show us the error message. You should also show us your input values. Thanks!
19th May 2020, 3:40 PM
Lothar
Lothar - avatar
0
class Report : def __init__(self, subject, marks): self.subject = subject self.marks = marks maths = Report("Maths", 98) science = Report ("Science", 87)
18th May 2020, 2:30 PM
Manish
Manish - avatar