Advertisement
Guest User

Untitled

a guest
Jun 12th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import random
  2.  
  3. #
  4. # Add your count function here
  5. #
  6.  
  7. scores = []
  8.  
  9. for x in range (0, 30):
  10.   scores.append(random.randint(0, 10))
  11.  
  12. print(scores)
  13.  
  14. def count(score, scores):
  15.   S= 0
  16.   for i in scores:
  17.     if i == score:
  18.       S += 1
  19.   return S
  20.  
  21. num = int(input ('What score do you want to check?'))
  22. top_scorers = count(num, scores) # Count function called here
  23.  
  24. print("{0} learners got that score".format(top_scorers))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement