Print fails on if/elif/else statements when defining string from input


#1

When I get the value for Alpha from keyboard input, the print statements do not show, but the function does return the correct value. Any thoughts? Thanks.

When I get the value for Alpha from keyboard input, the print statements do not show, but the function does return the correct value. Any thoughts? Thanks.

Alpha = input("Enter a whole positive number:")
def the_flying_circus():
  if Alpha == 1:    
         print "Correct"
         return True     
     elif Alpha > 1:
         print "Too large"
         return False
     else:
         print "Please input a whole positive number"
         return False

#2

Functions do not execute unless you call them.


#3

Is it not calling the function when it compares the value of Alpha? :confused:


#4

no, you defined a function, and inside the function you do stuff, but the function never gets called. calling a function is easy:

the_flying_circus()

simple the functionname with () and if the function where to have parameters, you could enter them there.