Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def countscores(list, score):
- countstore = 0
- for item in list:
- if item == score:
- countstore += 1
- return countstore
- scores = []
- for x in range (0, 30):
- scores.append(random.randint(0, 10))
- print(scores)
- top_scorers = countscores(scores, 10) # Count function called here
- print("{0} learners got top marks".format(top_scorers))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement