Advertisement
ammaokeke

Untitled

Apr 17th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import random
  2.  
  3. #
  4. def count(marks,scores):
  5. amt=0
  6. for score in scores:
  7. if score==marks:
  8. amt=amt+1
  9. return amt
  10.  
  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) # Count function called here
  20.  
  21. print("{0} learners got top marks".format(top_scorers))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement