Python noob here. I have a list of numbers represented as strings. Single digit numbers are represented with a zero and I'm trying to get rid of the zeroes. For instance, ['01', '21', '03'] should be ['1', '21', '3'].
My current solution seems a bit clumsy:
for item in list:
if item[0] == '0':
list[list.index(item)] = item[1]
I'm wondering why this doesn't work:
for item in list:
if item[0] == '0':
item = item[1]