Why does this function(the_flying_circus()) return None rather than True?


#1

def the_flying_circus():
a=-1
if a>0:
return True
elif a<0 or a==0:
a=-1*a
else :
return a>=0

-all indents are correctly written
p.s. how can I utilize raw_input() here?


#2

There is no return statement in your elif branch, so for a < 0 or a == 0 nothing will be returned.

You should change your function so that it takes a parameter a instead of setting a to -1 inside of the function. Then you can use raw_input().

input = raw_input("Pick a number:")
print the_flying_circus(input)