Python Forum

Full Version: Help (Syntax error)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This code is not working:
import time
guess = ''
answer = ''
points = 0
lives = 9
heart = u"\u2661"
def correct():
    points += 1
    print("correct!")
    time.sleep(0.2)
    print("Lives left: " + lives * heart

def checkanswer():
    if answer == Guess
        Correct()
    if answer != Guess
        Wrong()
This gives the error:
File "C:/Users/bcola/Desktop/Other/python/Guessing game.py", line 13
def checkanswer():
^
SyntaxError: invalid syntax



Please help
You are missing a ) at then end of line 11. Always look at the line before what the error says when you get a Syntax error.