Can someone help me fix this syntax error example in my code? or Why am I getting a syntax error exam

20 Replies, 1285 Views

Hey! The issue here is that you're using a single equals sign (`=`), which is for assignment, not comparison. In Python, you need `==` to check equality.

So your code should be:
```python
if x == 5:
print("Hello")
```

This is a super common syntax error example, especially for beginners. Happens to everyone!

Messages In This Thread



Users browsing this thread: 1 Guest(s)