Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import random
  2.  
  3. def noFreq():
  4.   count = 0
  5.   freq = scores[0]
  6.  
  7.   for i in scores:
  8.     values = scores.count(i)
  9.     if values>count:
  10.       count = values
  11.       freq = i
  12.  
  13.   return freq,count
  14.  
  15.  
  16. scores = []
  17. for i in range(18):
  18.   value = random.randint(0,100)
  19.   scores.append(value)
  20.  
  21. print(scores)
  22. print ("max value",max(scores))
  23. print ("min value",min(scores))
  24. print("most common, no of appearances",noFreq())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement