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
Write the program with maximum three lines of code and that assigns first 5 multiples of a number to 5 variables and then print them.
Write a program to read a number n and print n2, n3 and n4.
Write a short program that asks for your height in centimetres and then converts your height to feet and inches. (1 foot = 12 inches, 1 inch = 2.54 cm).
Write a Python program that accepts radius of a circle and prints its area.