Q:

Python if-elif-else not working when in theory it should be?

I am working with python and and for a homework assignment in college, which is now late because of this I cannot get the if-elif-else function to work.. D:
This is my code and I can't get it to work properly. It only prints Nothing to brag about. Even if the score is 1000.
score = raw_input("What is your score?")

if (score >= 0, score <= 999):
    print "Nothing to brag about."

elif (score >= 1000, score <= 9999):
    print "Good Score."

elif (score >= 10000):
    print "Very Impressive!"

else:
    print "That's not a legal score!"

A:

First, you don't need those parentheses;
Second, you need to use and instead of ,;
Third, you need to cast input to int because raw_input function returns a string.
If you type help(raw_input) in interactive terminal, you should see the definition:
raw_input(...)
    raw_input([prompt]) -> string

Fixed code:
score = int(raw_input("What is your score?"))

if score >= 0 and score <= 999:
    print "Nothing to brag about."

elif score >= 1000 and score <= 9999:
    print "Good Score."

elif score >= 10000:
    print "Very Impressive!"

else:
    print "That's not a legal score!"

A:

You can use the and operator to do your logic properly, or, even better, the syntax for a<b<c booleans in Python. Commas usually indicate tuples in Python. Also don't forget to convert your input to an int.
score = int(raw_input("What is your score?"))

if 0 <= score <= 999:
    print "Nothing to brag about."

elif 1000 <=score <= 9999:
    print "Good Score."

elif score >= 10000:
    print "Very Impressive!"

else:
    print "That's not a legal score!"

