Hello, I have been creating code that I need to convert strings in a list into integers.
For some reason it doesn’t alter the second item in the list.
Here is the code:
for num in num_list:
num_list.remove(num)
num = int(num)
num_list.append(num)
print(num_list)
So if num_list contains ['1', '2', '3'] then the program returns ['2', 1, 3]
What am I doing wrong?