Advertisement
PhilHole

Untitled

Oct 24th, 2019
575
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. import random;
  2.  
  3. def printCard(card):
  4. if card == 11:
  5. print('Jack')
  6. if card == 12:
  7. print('Queen')
  8. if card == 13:
  9. print('King')
  10. if card == 14:
  11. print('Ace')
  12. else:
  13. print(card)
  14.  
  15. playerOneCards = []
  16. playerTwoCards = []
  17.  
  18. playerOneName = input('Enter name for player one:')
  19.  
  20. for i in range(4):
  21. playerOneCards.append(random.randint(2, 14))
  22. playerTwoCards.append(random.randint(2, 14))
  23.  
  24. print(playerOneName + ' has the cards:')
  25. for card in playerOneCards:
  26. printCard(card)
  27.  
  28. playerTwoName = input('Enter name for player two:')
  29.  
  30. print(playerTwoName + ' has the cards:')
  31. for card2 in playerTwoCards:
  32. printCard(card2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement