I have a text file numbers.txt that has numbers listed like so
1,2,3,4,5
6,7,8,9,10
11,12,13,14,15
but when i read the text using this:
with open('numbers.txt') as data:
line = data.readlines()
File = [line[0].strip()]
print(File)
it prints ['1,2,3,4,5']
but i also want to use the add function like so:
File1 = [line[1].strip().__add__(File)
print(File1)
it prints ['1,2,3,4,5', '6,7,8,9,10']
but i need it to print [1,2,3,4,5,6,7,8,9,10] so i can use the count function later on
How could i fix this?
I tried using the np.array function but i can't __add__ arrays
i tried converting it to a list list(line[1].strip()] but when i did, it made more quotes and 10 turned into this: ('1', '0') but i want the numbers complete