Help (Syntax error) - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Help (Syntax error) (/thread-17318.html) |
Help (Syntax error) - Vqlk - Apr-06-2019 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 RE: Help (Syntax error) - ichabod801 - Apr-06-2019 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. |