我在周末开始学习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 car
stop - to stop the car
quit - to exit
help - to display this menu
>
None
翻翻过去那场雪
芜湖不芜
相关分类