第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

新手之路:代碼定義錯(cuò)誤

新手之路:代碼定義錯(cuò)誤

阿晨1998 2018-07-16 11:20:21
代碼如下:import randomsecret = random.randint(1,99)gurss = 0tries = 0print "AHOY! I'm the Dread Pirate Roberts, and I have a secret!"print "It is a number from 1 to 99. I'll give you 6 tries."while guess != secret and tries < 6:    guess = input ("What's yer guess?")    if guess < secret:        print "Two low,ye scurvy dog!"    elif guess > secret:        print "Two high,landubber!"    tries = tries + 1if guess == secret:    print "Avast! Ye got it! Found my secret, ye did!"else:    print "No more guesses! Better luck next time,matey!"    print "The secret number was", secret運(yùn)行錯(cuò)誤提示:Traceback (most recent call last):  File "C:/Users/whisk/Desktop/編程學(xué)習(xí)/list.1-2.py", line 7, in <module>    while guess != secret and tries < 6:NameError: name 'guess' is not defined是根據(jù)書籍《父與子的編程之旅》學(xué)習(xí)的,剛開始,對(duì)照了書上和自己寫的代碼,并沒有拼寫錯(cuò)誤,希望有大神點(diǎn)一下,謝謝。
查看完整描述

2 回答

?
SMILET

TA貢獻(xiàn)1796條經(jīng)驗(yàn) 獲得超4個(gè)贊

gurss = 0

guess

拼寫錯(cuò)誤。。。。


查看完整回答
反對(duì) 回復(fù) 2018-07-17
?
慕娘9325324

TA貢獻(xiàn)1783條經(jīng)驗(yàn) 獲得超4個(gè)贊

第三行 guess

查看完整回答
反對(duì) 回復(fù) 2018-07-17
  • 2 回答
  • 0 關(guān)注
  • 322 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)