I have a list of lists. For example a sample_list
[['11', 'A', '23.45'], [['15', 'B', '11.63'], ['53', 'C', '62.78']]
I want to convert only the third column into the int. so the output looks something like:
[['11', 'A', 23.45], [['15', 'B', 11.63], ['53', 'C', 62.78]]
I tried doing a bunch of things including:
for item in sample_list:
item[2] = int(item[2])
But no matter what I do, I keep getting an error:
invalid literal for int() with base 10: '23.45'
Not sure what I am doing wrong but i am not allowed to use any libraries like pandas or anything.