I wrote this code 

```
for i in range(40):
    f=open('file.txt','r')
    if i%2==1:
        f.readlines()[i]

```

But it didnt print anything on console.

Whereas if I write it this way, it does:-

```
for i in range(40):
    f=open('fil.txt','r')
    if i%2==1:
        p=f.readlines()[i]
        print p

```

Why is it so. `f.readlines()` works on console, but why it doesnt work inside a loop ?