Here is my code (A pig **Latin translator** from a text file): 

```
f = open('Assignment_4.txt', 'r+')

for line in f:
    print(line)

def pigLatin():
    var = 'ay'
    wordL = f.lower()
    firstLetter = wordL[0]
    pigLatin = wordL + firstLetter + var
    pigLatin = pigLatin[1:]
    print(pigLatin)

```

It works for defined strings but won't for the file. Help is appreciated!