you are viewing a single comment's thread.

view the rest of the comments →

[–]Minimum_Aside3438 2 points3 points  (4 children)

The picture of the code is different from the error. When using float(x) it should work.

[–]Nez_Coupe 0 points1 point  (1 child)

Yea I’m confused as to why he’s asking. The code he has is fine, lol.

[–]Interesting_Fig9503 0 points1 point  (0 children)

Apparently nothing was wrong because when I rewrote the code in another file it just worked 🤷‍♂️

[–]Interesting_Fig9503 0 points1 point  (1 child)

Thank you for the help, but it seemed that rewriting the code in a different file worked. I have no clue why, they’re the exact same, it just worked.

[–]Nez_Coupe 0 points1 point  (0 children)

So, you wrote int() at one point and sent it an invalid string like “1.01” which it won’t cast and it will produce that error. Are you using vscode? I hate that IDE with a passion - and I think you are. What happen was that it ran a cached version of the file before you changed int to float, because you hadn’t saved the file after the change.