dict = {0: ['2', '6'], 1: ['2'], 2: ['3']}
print("Original: ")
print(dict)
for key,vals in dict.items():
vals = [int(s) for s in vals]
print("New: ")
print(dict)
Output:
Original:
{0: ['2', '6'], 1: ['2'], 2: ['3']}
New:
{0: ['2', '6'], 1: ['2'], 2: ['3']}
I can't figure why the list of values is not changing, I have tried the map() function and it also does not work, any reason why?