Getting an 'invalid decimal literal' error in my code—what am I missing?

18 Replies, 1696 Views

Hey everyone,

Sooo I’m getting this *invalid decimal literal* error in my code, and I’m kinda stuck. Like, I thought I was doing everything right, but apparently not? 😅

Here’s the thing—I’m trying to assign a number to a variable, but Python’s like, “nah, invalid decimal literal, bro.” I’ve checked the syntax, and it *looks* fine to me, but idk what I’m missing.

Anyone else run into this before? Is it something dumb like a typo or spacing issue? Or am I just blind? Lol.

Here’s a snippet if it helps:
```python
x = 09.5
```
Thanks in advance! 🙏

Messages In This Thread
Getting an 'invalid decimal literal' error in my code—what am I missing? - by - 16-01-2025, 01:48 AM



Users browsing this thread: 1 Guest(s)