• Register
0 votes

Problem :

Every time I submitted Python  code, I got

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

6.9k points

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'
36.1k points
edited by

Related questions

1 vote
1 answer 17 views
Problem: In Python while practising the few question from c language i tried to implement the few of the program but most of the time it come up with the syntax error or the intend error can you help what actually i am missing the syntax error in python every time i execute it.
asked Jun 3 Gavin 15.2k points
0 votes
2 answers 476 views
Problem : While I am running the python code on windows with python 3.5 64 bit. Getting below error. overflowerror: python int too large to convert to c long
asked Oct 22, 2019 peterlaw 6.9k points
1 vote
1 answer 4 views
Problem: I am a new student of Python programming. I mean really new in this line. I just installed python and an IDE to learn the language on a daily basis. I’ve tried reading the Python documentation, but it’s a bit tough to understand everything by ownself. ... question lies here is what is the purpose of using the %s in this above program? Could you please give me a brief on this?
asked Jun 27 adamSw 10.9k points
0 votes
1 answer 23 views
I start programming recently and I love to do programming but every day I'm facing new problems. I wrote a java code where I can easily take two int input from a user and I'm able to print the smallest value. But I'm doing all things in the main method. I don't want to do ... smallest; if(a>b){ smallest = b; }else{ smallest = a; } System.out.println("Smallest is: "+smallest); } Here is my code.
asked May 3 samhaz 5k points
0 votes
2 answers 230 views
Problem : I am facing the below error in my program saying: Lyrics.java:11: error: cannot find symbol  Cube(b); ^ symbol: method Cube(int) location: class Lyrics Lyrics.java:15: error: incompatible types: possible lossy conversion from double to int  return Math.pow ... unable to understand the above error saying cannot find symbol. Please help me I am really been stuck on this error for a while.
asked Jan 14 jwilliam 3.9k points