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

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

python 輸出中的“無(wú)”

python 輸出中的“無(wú)”

長(zhǎng)風(fēng)秋雁 2023-09-19 15:02:28
我在周末開(kāi)始學(xué)習(xí)Python,每當(dāng)我要求用戶(hù)輸入時(shí),在打印內(nèi)容之后,輸出中總是有一個(gè)None。代碼:    print('start - to start the car')    print('stop - to stop the car')    print('quit - to exit')    print('help - to display this menu')        contador = 1    while contador == contador:        user_input = input(print('> '))        user_input.upper()        if user_input == 'HELP':            print('start - to start the car')            print('stop - to stop the car')            print('quit - to exit')            print('help - to display this menu')        elif user_input == 'START':            print('Car started... Ready to go!!')        elif user_input == 'STOP':            print('Car stopped!')        elif user_input == 'QUIT':            break        else:            print('Command not identified!')輸出:start - to start the carstop - to stop the carquit - to exithelp - to display this menu>None
查看完整描述

2 回答

?
翻翻過(guò)去那場(chǎng)雪

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

input(print('> '))顯示None因?yàn)?code>print()返回None. 只需執(zhí)行input('> '),這將打印正確的內(nèi)容。



查看完整回答
反對(duì) 回復(fù) 2023-09-19
?
蕪湖不蕪

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

修復(fù)第8行

user_input = input('> ')

您不需要編寫(xiě) print 輸入接受在獲取輸入時(shí)要顯示的字符串。


查看完整回答
反對(duì) 回復(fù) 2023-09-19
  • 2 回答
  • 0 關(guān)注
  • 134 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

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

幫助反饋 APP下載

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

公眾號(hào)

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