【发布时间】:2021-08-14 09:38:08
【问题描述】:
你能告诉我以下python代码的第6行是怎么回事吗?
command = ""
started = False
while True:
command = input("> ")
if command == "start":
if started: #didnt understand this
print("Car already started")
else:
started = True
print("Car started ... ready to go")
elif command == "stop":
print("Car stopped")
elif command == "help":
print('''start - to start the
stop - to stop the car
quit - to exit''')
elif command == "quit":
break
else:
print("I don't get it")
【问题讨论】:
-
你有什么不明白的>
标签: python-3.x loops if-statement while-loop