Python Program to find the average of 5 subjects


In this program, You will learn how to find an average of 5 subjects in Python.


sum = a + b + c + d + e

avg = sum / 5

Example: How to find the average of 5 subjects in Python.

print("Enter five subjects marks:")
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

sum = a + b + c + d + e

avg = sum / 5

print("Sum of five subjects is:", sum)
print("Average of subjects is:", avg)

Output:

Enter five subjects marks:
10
20
30
40
50
Sum of five subjects is: 150
Average of subjects is: 30.0

Xiith is created for educational, experimental, and schooling purpose. Examples on Xiith are made easier to make a better or basic understanding. Tutorials, testimonials, and examples are continuously checked to avoid delusion, but we cannot take complete responsibility of all programs on Xiith. When you are operating this site, you have to agree to read and accept our terms of use, cookie and privacy policy.Copyright © 2020 by Xiith. All Rights Reserved. About us.