May-19-2020, 03:48 AM
(This post was last modified: May-19-2020, 04:00 AM by gabejohnsonny21.)
I have a text file which is written like this
a
I have a text file which is written like this:
a \t b \t c \t d
d \t c \t d \t a
a \t b \t d \t a
I want to take this into a list so I wrote:
How do i fix this?
a
I have a text file which is written like this:
a \t b \t c \t d
d \t c \t d \t a
a \t b \t d \t a
I want to take this into a list so I wrote:
while(len(a_contents) > 0): list1.append(a_contents.strip()) a_contents = a.read(size2read)But the empty spaces become part of the list elements
How do i fix this?