473,215 Members | 1,238 Online

# Loops and Lists problem

16
Hey guys thanks for the help so far about all the problems i have been bringing on this forum. I got this problem i cant figure out how to start this program, its about collectnig student survey feedback regarding the quality of a programming unit. Each score is between -5 (hopeless) to + 5 (excellent). There are 20 scores to be input. If a particular score is outside the range -5 to +5 it is assumed to be spoiled, and a mark of 0 is used instead.

This is the confusing bit to calculate the average score and report on the quality of the unit, based on the average score. If the score is less than -3, report “bad”, if less than 0 “poor”, if 0 “average”, if less than or equal to 3 “quite good”, if more than 3, “excellent”.

Thanks
Jun 25 '07 #1
1 1000
bvdet
2,851 Expert Mod 2GB
Hey guys thanks for the help so far about all the problems i have been bringing on this forum. I got this problem i cant figure out how to start this program, its about collectnig student survey feedback regarding the quality of a programming unit. Each score is between -5 (hopeless) to + 5 (excellent). There are 20 scores to be input. If a particular score is outside the range -5 to +5 it is assumed to be spoiled, and a mark of 0 is used instead.

This is the confusing bit to calculate the average score and report on the quality of the unit, based on the average score. If the score is less than -3, report “bad”, if less than 0 “poor”, if 0 “average”, if less than or equal to 3 “quite good”, if more than 3, “excellent”.

Thanks
Maybe this will get you started:
Expand|Select|Wrap|Line Numbers
1. scores = [1,2,3,4,0,1,-2,-3,4,-5,6,-6,4,3,-2,1,4,2,-1,-2]
2. no_scores = len(scores)
3. total_score = sum([score for score in scores if score >= -5 or score <= 5])
4. average_score = total_score/float(no_scores)
Jun 26 '07 #2