Python Practice › List Programs › Program 88
Percentage from marks
Write a Python program to calculate the percentage from a list of marks out of 100 each.
Input
[80, 50, 70, 90, 95]
Output
77%
Approach
- Total obtained divided by total possible, times 100.
Solution
marks = [80, 50, 70, 90, 95]percent = sum(marks) / (len(marks) * 100) * 100print(f"{percent:.0f}%")Output
77%
Learn the concept
New to this topic? Read the lesson, then come back.