Python Practice › List Programs › Program 88

Percentage from marks

EasyList Programs · 88 of 100

Write a Python program to calculate the percentage from a list of marks out of 100 each.

Advertisement
Input
[80, 50, 70, 90, 95]
Output
77%

Approach

  1. Total obtained divided by total possible, times 100.

Solution

Python
marks = [80, 50, 70, 90, 95]percent = sum(marks) / (len(marks) * 100) * 100print(f"{percent:.0f}%")
Output
77%
Advertisement

Learn the concept

New to this topic? Read the lesson, then come back.

More list programs

← All 100 List Programs