This post has been answered, read it if you like.
I have been attempting to write a card-game in python 3, and I have been using a for loop to transfer cards from a deck list to hand list. I'm attempting to put this into a function, but command prompt crashes. help?
from random import *
print("Sam's Casino")
cards = ['1','2','3','4','5','6','7','8','9','10','J',
'Q','K','1','2','3','4','5','6','7','8','9','10','J',
'Q','K','1','2','3','4','5','6','7','8','9','10','J',
'Q','K','1','2','3','4','5','6','7','8','9','10','J',
'Q','K']
shuffle(cards)
print(cards)
hand1 = []
hand2 = []
count = 0
def deal(cards):
for card in cards:
if count < 4:
hand1.append(card)
count += 1
if count > 3 and count < 8:
hand2.append(card)
count += 1
deal(cards)
print(hand1)
print(hand2)
input('>')
Edit: No error is recieved, it simply closes.