Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Week two, Test scores using the count function
- import random
- scores=[]
- for x in range(0,30):
- scores.append(random.randint(0,10))
- scores.sort()
- print(scores)
- def test_scores(Stud_numbers, scores):
- numbers=0
- for score in scores:
- if score==Stud_numbers:
- numbers= numbers+1
- print (" {0} pupils got {1} mark".format(numbers, Stud_numbers))
- for Stud_numbers in range(0,11):
- test_scores(Stud_numbers, scores)
- # i don't fully understand this, i cheated by looking at somebody elses.
- # i don't understand why numbers is not just 0 to 10 and gives the actual number of
- #students who got that score. line 15 i understand how it reads the text string, but dont undersand how stud_
- #numbers is giving the pupil mark and that numbers is givinng the number of pupils.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement