我正在學習Python,並且無法計算出爲什麼以下不起作用。有關條件語句的新手查詢
任何人都可以建議嗎?
感謝
# Make sure that the_flying_circus() returns True
print "What is your number?"
num = input()
print "What is bla?"
bla = input()
def the_flying_circus():
if num ==4 and bla=="bla": # Start coding here!
return True
print "Well done!"
# Don't forget to indent
# the code inside this block!
elif num == 2 or bla== zog:
print "OK"
# Keep going here.
# You'll want to add the else statement, too!
else:
print "Bad luck!"
the_flying_circus()
這是Python的2.x的?如果是這樣,請使用'raw_input()'而不是輸入。或者更好,[下載並學習Python的最新(穩定)版本](https://www.python.org/downloads/win)。 –
「不起作用」不是很有用的信息。代碼應該做什麼,它實際上做了什麼? – interjay
你可能是指''zog''除非'zog'在別處被定義爲一個變量 –