The Big If


#1

# Make sure that the_flying_circus() returns True
def the_flying_circus():
    x = raw_input ("Enter a number")
    if (x <=12):
       print ("Wow! You must still be a child!")
       return True 
    elif (x >12 and x <=19):
       print ("Wow! You must be a teenager!")
       return True
    elif (x >19 and x <=29):
       print ("Wow! You must be in your twenties!")
       return Ture
    else: 
       print ("Wow! You must be old!")
       return True
the_flying_circus()

why does my else take over when I type a number. No matter the number, it prints, "Wow! You must be old!" please help


#2

I am aware that my indenting is wrong, since I copied and pasted but the code does overall work for me; it just doesn't respond the way I was hoping for.


#3

please i need help for this one (6 < 9) not "True" == "False"


#4

Apart from misspelling True on line 12, it is fine. I can pass with your code, could be your browser is sending cached data, try a different browser

for next time, use one of the two following options to make your code/indent is visible:

select your code and press ctrl + shift + c (or cmd + shift + c if you use a mac)

if this instructions are unclear, you can also insert 3 backticks before and after your code, like so:

```
<p>visible</p>
```

the backtick is located above the tab key on your keyboard


#5

@zpeedyx

The else is only running because of this line:

x = raw_input ("Enter a number")

This will give you a string such as, "345678". To fix you would do:

x = int(raw_input("Enter a number"))

#6

You have to type a number when it does that. Also press enter when you type the number.


#7

Thanx it helps a lot


#8

In the lesson it will let you run the program but it wont let you go forward because of int. if you remove that it will pass the lesson but the answer it will always be the else "you must be old"

Cheers
Christian