Click here to Skip to main content
15,902,492 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
This kid took N classes last semester and wants to know her average mark.
Average mark is the sum of her marks divided by the number of courses she took.
N lines follow, each containing a single nonnegative integer ai, indicating Pusheen's mark in class i.

Constraints
-N∈{1,2,5,10}

-0≤ai≤100

-In tests worth 3 marks, N=1.

-In additional tests worth 5 marks, N=10.


I dont understand what the constraints mean

What I have tried:

number = int(input())
sumOfMark = int(input())
if number == 1:
  print(round((sumOfMark/number),1))
elif number == 2:
  print(round((sumOfMark/number),1))
elif number == 3:
  print(round((sumOfMark/number),1))
elif number == 10:
  print(round((sumOfMark/number),1))
Posted
Updated 1-Feb-19 19:44pm

1 solution

Quote:
I dont understand what the constraints mean

N∈{1,2,5,10}
N can only value values in this list: 1, 2, 5, or 10. No other values of N are valid
0≤ai≤100
Each of the N lines has a single value, which is between 0 and 100 inclusive.
In tests worth 3 marks, N=1.

In additional tests worth 5 marks, N=10.
These are obvious.

N is the number of courses, ai is the grade for each course i

If you still don't understand, you need to talk to your tutor.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900