KnowledgeBoat Logo

Computer Science

Write Python program that accepts marks in 5 subjects and outputs average marks.

Python

Python Funda

276 Likes

Answer

m1 = int(input("Enter first subject marks: "))
m2 = int(input("Enter second subject marks: "))
m3 = int(input("Enter third subject marks: "))
m4 = int(input("Enter fourth subject marks: "))
m5 = int(input("Enter fifth subject marks: "))
avg = (m1 + m2+ m3+ m4 + m5) / 5;
print("Average Marks =", avg)

Output

Enter first subject marks: 65
Enter second subject marks: 78
Enter third subject marks: 79
Enter fourth subject marks: 80
Enter fifth subject marks: 85
Average Marks = 77.4

Answered By

145 Likes


Related Questions