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

20 Replies, 898 Views

Title: "Why am I getting a syntax error example here? What’s wrong?"

Hey everyone,

I’m stuck on this stupid syntax error example in my code and can’t figure out what’s breaking it. Here’s the snippet:

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

The error says "invalid syntax" and points at the equals sign. I thought this was how you check equality??

Am I missing something obvious?

Also, I’m kinda new to coding, so if anyone can explain why this is a syntax error example, that’d be awesome.

Thanks in advance!

(Using Python 3 btw)

Messages In This Thread
[b]"Can someone help me fix this syntax error example in my code?"[/b] or [b]"Why am I getting a syntax error exam - by - 15-12-2024, 03:30 AM



Users browsing this thread: 1 Guest(s)