Advertisement
pedrolemoz

Sorteio

Sep 30th, 2019
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.34 KB | None | 0 0
  1. import random
  2.  
  3. objects = ["Maçã", "Uva", "Laranja", "Limão", "Tangerina"]
  4. new_list = []
  5.  
  6. print("Items a sortear:")
  7. for i in objects:
  8.     print(i)
  9.  
  10. for i in range(100000):
  11.     new_list.append(random.choice(objects))
  12.  
  13. print("\nItems sorteados: ")
  14. for i in range(len(objects)):
  15.     print(f"{objects[i]}: {new_list.count(objects[i])} vezes")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement