if you want to do it that way, you would have to do
elif input < 10 and input >= 5:
but there's an easier way.
You can just say
elif input >= 5:
because if it's NOT less than ten, then it will fall into the if statements condition. It can only match one of the conditions, (if, elif, else, etc), so whichever one it matches first is what it will act on.
I hope this makes some kind of sense.
Also, the statements shouldn't have the word "is" in them.
Personally, how I would go about writing this is:
if input >= 10:
elif input >= 5:
The reason I would say use else in this case rather than another elif is because input being less than 5 is the only other option, so else covers it.
Also remember that else cannot have a condition, because I know that I've forgotten that and I've seen other people forget as well.
Some more notes you may find interesting:
This isn't exactly an answer to your question, but it involves taking the input, and returning things based on the range of it.
I wrote a tiny, quite unimpressive program, just for the purpose of this to explain using the range function in an if or elif condition.
input = raw_input("enter a number")
if int(input) in range(9):
print "between 0 and 9"
elif int(input) in range(15):
print "between 9 and 15"
I'll walk through it for you.
The first line is taking the user input, using the function raw_input.
Next, the if statement is introduced. (remember that when you take user input and you got a number, you have to convert it to an integer or float using the function
int() or else it's dealt with like a string.) What the condition is testing for is if the number is in the range of 0 to 9. If you just give one number to the function, it will assume that you're incrementing by one, and that you started at zero. You'll learn more about range later, and how you can give up to three arguments.
Basically, that's all there is to this program, but you can also note that in the second one, if the user input is above nine and less than 15, it will fall into that category, even though the only visible condition is that it needs to be less than 15. The reason for this is because it doesn't pass the first
if check, so it moves on and realizes that it can pass the elif condition.