我在周末開始學習Python,每當我要求用戶輸入時,在打印內容之后,輸出中總是有一個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
添加回答
舉報
0/150
提交
取消