我在周末开始学习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
提交
取消