Jul-19-2023, 01:17 PM
hi
i am a beginner in python, so this problem that i encountered, maybe is silly.
i wrote in idle:
y=['l', '2', '3', '5', '8', '6', '9']
when i write int(y[0]) then i have an error as:
Traceback (most recent call last):
File "<pyshell#87>", line 1, in <module>
int(y[0])
ValueError: invalid literal for int() with base 10: 'l'
but when i write int(y[1]) or int(y[2]) , the correct values are displayed and there is no error. i searched net for this but i can not true thing.
thanks
i am a beginner in python, so this problem that i encountered, maybe is silly.
i wrote in idle:
y=['l', '2', '3', '5', '8', '6', '9']
when i write int(y[0]) then i have an error as:
Traceback (most recent call last):
File "<pyshell#87>", line 1, in <module>
int(y[0])
ValueError: invalid literal for int() with base 10: 'l'
but when i write int(y[1]) or int(y[2]) , the correct values are displayed and there is no error. i searched net for this but i can not true thing.
thanks