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