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