Programmers learn & share
0 votes
63 views

Problem :

Every time I submitted Python  code, I got

"invalid literal for int() with base 10:"

by (6.9k points)   | 63 views

1 Answer

0 votes

Solution :

The error is "invalid literal for int() with base 10:". This means that the argument that you passed to int doesn't look like a number. In other words it's either empty, or has a char in it other than a digit.

This can be reproduced in a python shell.

>>> int("x")
ValueError: invalid literal for int() with base 10: 'x'
by (36.1k points)  
edited by
2,227 questions
2,734 answers
59 comments
241 users