Q:

Interpreter ignores elif clause entirely

The code in question is this:
age = input("How old are you?")

if ( int(age) ):
  print ( "Congratulations! Some people die before they get to be %s years old!" % (age) )

elif ( age < 12 ):

  print ( "You're way too young to hear all this swearin'. Get out." )

else:

  print ( "That's not how this works. That's not how any of this works." )
  raise SystemExit

print ( "You probably shouldn't brag, but that's quite a feat!" )

The if clause, seems to trigger fine, as does the "else" clause, which, if working as intended, ought to print the given message and close the program if the given input is anything other than a number. The problem is the elif clause, which the interpreter seems to just completely ignore. Even when I put 1, 2, 3 or 4 into the program - which is indisputably lower than 12 - it just continues on to print the "Congratulations!" line. I'm very confused and new to this - any insight would be highly appreciated. Thanks in advance!

A:

if int(age). What is this doing? It's just checking for a boolean value which is true. If it's true then it will always go into the if statement. In Python everything has a "truthiness" so any number which isn't equal to zero will result in the if being entered. 
Here's something closer to what you're trying to achieve (I think?). You could edit to re-prompt for input, raise an error, whatever else.
age = input("How old are you? ")
if not age.isdigit():
    print("Invalid age, must be numeric")
elif int(age) < 12:
    print("You're way too young to hear all this swearin'. Get out.")
else:
    print("Congratulations! Some people die before they get to be %s years old!" % (age))

