当我将函数分配给变量时,它将运行该函数。
我试图将函数更改为func而不是func(),但是我不知道从哪里开始。
def deck():
global card
ranks = ["Q", "K", "J", "10","9", "8",
"7", "6","5","4","3","2","A"]
suits = ["Clubs", "Diamonds", "Hearts", "Spades"]
for i in range(56):
for i in (ranks):
rank = random.choice(ranks)
suit = random.choice(suits)
card_loop = card_loop + 1
card = ("{} of {}").format(rank, suit)
print (card)
hit = deck
#hit or stand class
stand = (0)
class hit_stand_class:
def __init__(self, hit, stand):
self.hit = print (card)
self.stand = stand
hit_stand = hit_stand_class(hit, stand)
hit_stand.stand
`````````````
and it runs function()
````````````