Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5103

Python • Re: ValueError: invalid literal for int() with base 10:

$
0
0
Has something been changed that would cause this error,
I don't know. My crystal ball is broken.

Add some debug (even a print(thing_im_passing_to_int) will do) so that you can see what the "invalid literal" is.

At a guess, whatever you're trying to convert to an int is a string that contains characters other than [+-0-9.] Or it's a hex (or higher) string and you've not told int() which base it should be using (so it tries the default, which is base 10)

Statistics: Posted by thagrol — Fri Jan 05, 2024 12:46 am



Viewing all articles
Browse latest Browse all 5103

Trending Articles