Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Counts scores in range e.g. 0 to 3
- import random
- count = 0
- def count_scores(lst, mini, maxi):
- global count
- for num in lst:
- if num >= mini and num <= maxi:
- count += 1
- print(count)
- scores = []
- for x in range (0, 30):
- scores.append(random.randint(0, 10))
- print(scores)
- top_scorers = count_scores(scores, 0, 3) # count_scores function called here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement