Ich lerne Python und kann nicht herausfinden, warum das folgende nicht funktioniert.Newbie Abfrage über bedingte Anweisungen
Kann jemand beraten? Code unten
dank
# 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()
diese Python 2.x ist? Wenn ja, benutze 'raw_input()' anstelle von input. Oder noch besser, [lade und lerne die neueste (stabile) Version von Python] (https://www.python.org/downloads/win). –
"Funktioniert nicht" ist nicht sehr informativ. Was soll der Code tun und was macht er eigentlich? – interjay
Sie meinen wahrscheinlich "zog", es sei denn, zog ist anderswo als Variable definiert –