所以我有一些代码,像这样:
while loopCode == 1:
userCommand = raw_input('Type a command (type \'help\' for syntax): ')
if userCommand == help:
print 'flight: this command will be used to list a flight'
print 'restaurant: you will be prompted to type the name of the restaurant, and how much you will spend there'
如您所见,循环中有一个if条件while。但是当我被提示输入文本时,我应该输入“帮助”以激活条件。但是当我这样做时,while循环会忽略条件。这是为什么?
呼啦一阵风
相关分类