Advertisement
Guest User

Untitled

a guest
Mar 6th, 2015
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. list_of_suits= [] #Creating list of cards
  2. player_card = []
  3.  
  4. king_of_spades = 10 #Creating face cards for the spades deck.
  5. queen_of_spades = 10
  6. jack_of_spades = 10
  7.  
  8. king_of_clubs = 10
  9. queen_of_clubs = 10
  10. jack_of_clubs = 10
  11.  
  12. king_of_hearts = 10
  13. queen_of_hearts = 10
  14. jack_of_hearts = 10
  15.  
  16. king_of_diamonds = 10
  17. queen_of_diamonds = 10
  18. jack_of_diamonds = 10
  19.  
  20. ace_of_spades = [1,11] # Aces are either 1 or 11
  21. ace_of_clubs = [1,11]
  22. ace_of_hearts = [1,11]
  23. ace_of_diamonds = [1,11]
  24.  
  25.  
  26. spades = [ace_of_spades,2,3,4,5,6,7,8,9,10, jack_of_spades, queen_of_spades, king_of_spades]
  27. clubs = [ace_of_clubs,2,3,4,5,6,7,8,9,10, jack_of_clubs, queen_of_clubs, king_of_clubs]
  28. hearts = [ace_of_hearts,2,3,4,5,6,7,8,9,10, jack_of_hearts, queen_of_hearts, king_of_hearts]
  29. diamonds = [ace_of_diamonds,2,3,4,5,6,7,8,9,10, jack_of_diamonds, queen_of_diamonds, king_of_diamonds]
  30.  
  31. list_of_suits.append(spades)
  32. list_of_suits.append(clubs)
  33. list_of_suits.append(hearts)
  34. list_of_suits.append(diamonds)
  35.  
  36. random_list_of_suits = random.choice(list_of_suits)
  37.  
  38. random_card_number = random.choice(random_list_of_suits)
  39. random_list_of_suits.remove(random_card_number)
  40. player_card.append(random_card_number)
  41.  
  42. print player_card
  43. print list_of_suits
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement