+ 1
Value Error
When I assign a variable x as x = int(y) where y is string type variable, but contains only integers i get a value error: invalid literal for value with base 10: '1]' what's that supposed to mean?
4 Answers
+ 1
although you say that y only contain integers, the only possible way I can think that could result in the ValueError given is y="1["
I typed,
y="1["
x=int(y)
and got the same error;
ValueError: invalid literal for value with base 10: '1['
so please check for some sort of logic error
+ 1
No actually.. I tried again. And the issue is more complex
i have used what I said above in a function which was from, say p to q
there's another function from q to r, and I've used "return" to get the output of 1st function as input for the second, in order to achieve p to r.
now the thing is, if I run only 1st function, ir runs fine.
it gives the error I said, when I run both functions (like I said above)
0
can you please tell me what is the purpose of these p,q,r functions
do they return strings or integers?
0
gonna guess that the return statement is not returning a number by itself. maybe a list with one item?