Question: I have a text file in this format:

```
Item1       20  0   
Item2       10  1
Item3       5   0
Item4       15  1
Item5       25  1
Item6       30  0

```

How can I `.readlines()` in a way that it appends only "Item1" and "Item2"etc. to a list, and leaves the numbers and spaces out?

Answer: 
You could try the below,

```
l = []
with open('/path/to/the/file') as file:
    for line in file:
        l.append(line.split()[0])
print(l)

```

Through list\_comprehension.

```
print([line.split()[0] for line in open('/path/file')])

```
> 
> Using list comprehension:
> 
> 
> 

```
with open('sometext.txt', 'r') as f:
    list1 = f.readlines()
    print([ part.split(" ")[0] for part in list1 ])

```