Advertisement
Groudie

Lotto Script

Nov 1st, 2014
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. import random
  2.  
  3. # Test names
  4. contestants = ["Jack The Ripper", "Jesse James", "Ebola Chan", "Dennis Ritchie", "Gladstone Wellington", "Bo Madsen", "Novak Djokovic"]
  5. ary_keys = []
  6. rand_selected_keys = []
  7. single_ary_pos = 0
  8.  
  9. def results(x):
  10.     print "Congratulations ***%s*** You just won an invite" % (contestants[x])
  11.     print "\n"
  12.  
  13.  
  14. for i,a in enumerate(contestants):
  15.     ary_keys.append(i);
  16.    
  17.  
  18. rand_selected_keys = random.sample(ary_keys, 3)
  19.  
  20. print "AND THE WINNERS ARE:\n" 
  21.    
  22. for i in rand_selected_keys:
  23.     single_ary_pos = i
  24.     results(single_ary_pos)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement