Reputation: 1655
Very simple problem. Sorry I am new. I have this code below:
list = ['edward', 'jason', 'john']
for i in list:
print list
and it produces:
john
Why do I only get the last name? I want all of them. ie.
edward
jason
john
Upvotes: 0
Views: 90
Reputation: 250891
You should print i
not list
:
lis = ['edward', 'jason', 'john'] #don't use list as a variable name
for i in lis:
print i
Upvotes: 5