我在周末開(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
python 輸出中的“無(wú)”
長(zhǎng)風(fēng)秋雁
2023-09-19 15:02:28