python中name没有定义_Python;NameError:未定义名称“handsum”
我正在編寫一個基本的21點游戲,我挑戰自己盡可能多地編寫函數,代碼如下所示:funcA()
funcB()
funcC()
與之相反的是:
^{pr2}$
以下是我的代碼中存在的問題:def playerTurn():
global handSum
global cardOne
global cardTwo
global dealerSum
global upCard
global downCard
global bet
global newCard
global dealerNewCard
str(handsum)
str(cardOne)
str(cardTwo)
str(upCard)
str(money)
print("You are lying at", handSum, "with a", cardOne, 'and a', cardTwo
+ '.', "The Dealer has a", upCard, "facing up. You have $" + money + '.')
int(handsum)
int(cardOne)
str(cardTwo)
str(upCard)
str(money)
sleep(1.3)
bet=int(input('How much would you like to bet? '))
sleep(1.3)
money-=bet
總結
以上是生活随笔為你收集整理的python中name没有定义_Python;NameError:未定义名称“handsum”的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql 视图 字符集_MySQL创建
- 下一篇: python网格测试_测试d的numpy