What is the best way to write data retrieved from for loop?

```
L = ['abc','def','ghi']

for e in L:
    with open ('outfile.txt','w') as outfile:
        print (e, file=outfile)

##But the outfile.txt contains only:
##ghi
##
##        
##I have to write all the elements:
##abc
##def
##ghi

```