471,337 Members | 1,165 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

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 952
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

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by Bulba! | last post: by
46 posts views Thread by Neptune | last post: by
4 posts views Thread by Bill Moran | last post: by
12 posts views Thread by Sheldon | last post: by
12 posts views Thread by Rich Shepard | last post: by
16 posts views Thread by lisa.engblom | last post: by
1 post views Thread by Tommy Grav | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.