Guest User

Untitled

a guest
Jan 18th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. from random import choice
  2.  
  3. def deck():
  4. cards = range(1, 12)
  5. return choice(cards)
  6.  
  7. def diack():
  8. card1= deck()
  9. card2 = deck()
  10. hand = card1 + card2
  11. print hand
  12. if hand < 21:
  13. print raw_input("Would you like to hit or stand?")
  14. if "hit":
  15. return hand + deck()
  16. elif "stand":
  17. return hand
  18.  
  19. choice = raw_input("Would you like to hit or stand?")
  20. print choice
  21. if choice == "hit":
  22. return hand + deck()
  23. elif choice == "stand":
  24. return hand
  25.  
  26. print raw_input("Would you like to hit or stand?")
  27. if "hit":
  28. return hand + deck()
  29. elif "stand":
  30. return hand
  31.  
  32. cmd = raw_input("Would you like to hit or stand?")
  33. if cmd == "hit":
  34. return hand + deck()
  35. elif cmd == "stand":
  36. return hand
Add Comment
Please, Sign In to add comment