Ledger Nano X - The secure hardware wallet
SHARE
TWEET

Untitled

a guest Apr 7th, 2020 149 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import random
  2.  
  3. scores = []
  4.  
  5. for x in range (0, 30):
  6.   scores.append(random.randint(0, 10))
  7.  
  8. def count(threshold, scores):
  9.     top_scores = []
  10.     for i in scores:
  11.         if i >= threshold:
  12.             top_scores.append(i)
  13.     count = len(top_scores)
  14.     return count
  15.  
  16. def countSpecific(specific, scores):
  17.     specificCount = []
  18.     for i in scores:
  19.         if i == specific:
  20.             specificCount.append(i)
  21.     count = len(specificCount)
  22.     return count    
  23.  
  24. print(scores)
  25. print("{0} learners got top marks".format(count(10, scores)))
  26. print("{0} learners got a 7".format(countSpecific(7, scores)))
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