[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, 1845 Views

Classic! The colon is non-negotiable in Python.

Corrected code:
```python
if x == 5:
print("Hello")
```

If you’re new to Python, I’d suggest playing around with [Codecademy’s Python course](https://www.codecademy.com/). They drill this stuff into you so you don’t miss it.
Ugh, syntax error python strikes again! That colon is *everything*.

Here’s the fix:
```python
if x == 5:
print("Hello")
```

Btw, if you’re using Thonny (a beginner-friendly IDE), it highlights syntax errors in real-time. Super handy!



Users browsing this thread: 1 Guest(s)