User_guess = get_user_guess() returning syntax error, even after copy/paste


#1



Syntax error with

user_guess = get_user_guess()


To my knowledge it should work. I even got frustrated and copy/pasted the code from the hint section and it still returned the same error.


from random import randint
from time import sleep

def get_user_guess():
    user_guess = int(raw_input("Guess: "))
    return user_guess
  
def roll_dice(number_of_sides):
    first_roll = randint(1, number_of_sides)   
    second_roll = randint(1, number_of_sides)
    max_val = number_of_sides * 2
    print ("The max is : " + str(max_val)
    user_guess = get_user_guess()
    if user_guess > max_val:
        print ("That number is to big.")           
        return
    else:
        print ("Rolling...")  
        sleep(2)   
        print ("The first roll is! %d!" % (first_roll))  
        sleep(1)   
        print ("The second roll is! %d!" % (second_roll))   
        sleep(1)
        total_roll = first_roll + second_roll   
        print total_roll
        sleep(2)   
        if user_guess > total_roll: 
            print("Wrong!")   
        else: 
            print("Might be right, but wrong!")   
           
roll_dice(6)


#2

look at the parentheses on the line above the error message


#3

I can't believe I didn't see that! So simple! Thank you!


#4