• Register
0 votes

Problem :

Every time I submitted Python  code, I got

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

6 5 3
6,930 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'
9 7 4
38,600 points

Related questions

1 vote
1 answer 30 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.3k points
0 votes
2 answers 932 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
0 votes
1 answer 2 views
2 views asked 3 days ago Shaad Sh 800 points
0 votes
1 answer 38 views
Problem: I am a naïve to programming in C language. Please find below some relevant part of my code. I do not see any issues in my below code but still I keep on receiving below error: “Invalid operands to binary expression ('double' and 'double').” Please find ... is a double???? } printf ("%d\n", rem);          I need the modulo at any condition  but it is not working return 0;
asked Aug 13 Raphael Pacheco 4.9k points
0 votes
1 answer 4 views
import os A = os.path.join(os.path.dirname(__file__), '..') B = os.path.dirname(os.path.realpath(__file__)) C = os.path.abspath(os.path.dirname(__file__)) I usually just hard-wire these with the actual path. But there is a reason for these statements that determine path at runtime, and I would really like to understand the os.path module so that I can start using it.
asked 2 days ago psandprop 2.2k points