[b]"Getting a syntax error in Python—what am I missing?"[/b] or [b]"Why am I seeing a syntax error in Python when

22 Replies, 1859 Views

Hey! You're missing a colon after the `if` condition. It should be `if x == 5:` instead of `if x == 5`.

Python is super strict about colons in control structures. I used to mess this up all the time too. For quick checks, try pasting your code into an online Python validator like [Python Tutor](http://pythontutor.com/)—it highlights syntax error python issues instantly.

Hope that helps!

Messages In This Thread



Users browsing this thread: 1 Guest(s)