CBSE Class 12 Computer Science
Question 70 of 120
Review of Python Basics — Question 22
Back to all questions 22
Question Write a code to calculate and display total marks and percentage of a student from a given list storing the marks of a student.
marks_list = eval(input("Enter list of marks: "))
total_marks = sum(marks_list)
total_subjects = len(marks_list)
maximum_marks_per_subject = 100
total_marks_possible = maximum_marks_per_subject * total_subjects
percentage = (total_marks / total_marks_possible) * 100
print("Total Marks:", total_marks)
print("Percentage:", percentage)Enter list of marks: [85, 90, 78, 92, 88]
Total Marks: 433
Percentage: 86.6