SHARE
TWEET

Untitled

a guest Jun 12th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top