I have the following input:
669 866 147
15 881 210
662 15 70
Using .split('\n') on it, I am able to get a list of 3 strings. Then I would like to break each string to a list of strings and then convert those to int.
The code I'm trying to use for this so far is
for tr in numbers:
tr = tr.split()
tr = list(map(int, tr))
However, after the for loop closes nothing happened to the original list, so if I run this command print(type(numbers[0])) it returns <class 'str'>.
I am guessing this is due to the operation happening inside the loop so outside it nothing changed, so how would I go about making it so the original list updates too?