Hey all,
I am working on learning python, I have a question about lists.
When I call Variable x to equal numbers from a text file, I am getting the file returned in multiple lists.
with open('numbers.txt') as f:
for item in f:
n = item.split()
print (n)
I end up with numbers in the format.
['1']
['2']
['3']
I want to join these numbers into one list. Unless i'm mistaken, I am calling variable n as this group of lists. When I try to combine I end up with errors.
Essentially, I want to eventually add these numbers, but I will get to that some other time.
Am I in the correct direction? Should i be reading these numbees a different way?