You can use the argument unpacking operator *
(also called the "splat" operator):
>>> items = [ "Abby","Brenda","Cindy","Diddy" ]
>>> print(*items, sep='\n')
Abby
Brenda
Cindy
Diddy
>>>
You need to set sep='\n'
too because print
defaults to separating arguments with spaces.
Just for completeness, when you do:
print(item for item in items)
It will create a generator over the items in items
and then print that:
>>> items = [ "Abby","Brenda","Cindy","Diddy" ]
>>> print(item for item in items)
<generator object <genexpr> at 0x5ffffe02ee08>
>>>
If you want to use this in Python 2.x, you will need to import print_function
from the __future__
module first:
>>> from __future__ import print_function
>>>
>>> items = [ "Abby","Brenda","Cindy","Diddy" ]
>>> print(*items, sep='\n')
Abby
Brenda
Cindy
Diddy
>>>