Skip to content
Programs · Program 4-2

Q.A program to calculate average marks of n students where n is entered by the user.

Tripura TbseTextbookSubjective· 3mImportance★★★★★est
13% · 4/30 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

Read n students' marks one at a time into a list, then compute the average.

list1 = []
print("How many students marks you want to enter: ")
n = int(input())
for i in range(0, n):
    print("Enter marks of student", (i + 1), ":")
    marks = int(input())
    list1.append(marks)
total = 0
for marks in list1:
    total = total + marks
average = total / n
print("Average marks of", n, "students is:", average)

Output:

How many students marks you want to enter: 5
Enter marks of student 1 : 45 …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.