I have to read from file into a 2D list. The file looks like:
Jack 32
Perry 12
Tim 14
etc.
When I print the list it looks like:
['Jack 32', 'Perry 12', 'Tim 14']
But I need it to look like:
['Jack', '32', 'Perry', '12', 'Tim', '14']
So far my code looks like this:
with open('filelocation', 'r') as f:
content = f.readlines()
content = [x.strip('\n') for x in content]
print(content)