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

18 Replies, 1706 Views

Hey! So the *invalid decimal literal* error is happening because of the leading zero in `09.5`. Python doesn’t allow that in decimal numbers.

Just change it to `9.5` and you’re good.

If you want to avoid these kinds of errors in the future, [LeetCode](https://leetcode.com/) has some great Python challenges that’ll help you get the hang of syntax quirks.

Messages In This Thread



Users browsing this thread: 1 Guest(s)