Computer Science
Write a code to calculate and display total marks and percentage of a student from a given list storing the marks of a student.
Python
Python List Manipulation
7 Likes
Answer
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)
Output
Enter list of marks: [85, 90, 78, 92, 88]
Total Marks: 433
Percentage: 86.6
Answered By
5 Likes
Related Questions
Write a program to calculate the mean of a given list of numbers.
Write a program to calculate the minimum element of a given list of numbers.
Write a program to multiply an element by 2 if it is an odd index for a given list containing both numbers and strings.
Write a program to count the frequency of a given element in a list of numbers.