What is wrong with my python code?
Question: I'm trying to make a guessing game in python.

    
    
    from random import randint
    print "\nI'm thinking of a number, you have to guess what it is.\n"
    
    num = randint(1,100)
    guess = 0
    
    while guess != num:
        guess = raw_input("Guess the number \n")
        if guess < num:
            print "Guess higher next time \n"
        elif guess > num:
            print "Guess lower next time \n"
        elif guess == num:
            print "That's correct \n"
    

The problem is no matter what number I enter, I keep getting the "guess a
lower number" each time. So what's wrong?


Answer: With this:

    
    
    guess = raw_input("Guess the number \n")
    

`guess` is a string, not a number.

You can do this:

    
    
    guess = int(raw_input("Guess the number \n"))
    

to get an int.

