Advertisement
Guest User

Untitled

a guest
Aug 20th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import random
  2.  
  3. def count(tgt, sc_list):
  4. counter = 0
  5. i = 0
  6. for item in sc_list:
  7. if sc_list[i] == tgt:
  8. counter += 1
  9. i += 1
  10. return counter
  11.  
  12. scores = []
  13.  
  14. for x in range (0, 30):
  15. scores.append(random.randint(0, 10))
  16.  
  17. print(scores)
  18.  
  19. top_scorers = count(10, scores)
  20.  
  21. print("{0} scores were topscores".format(top_scorers))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement