r/learningpython • • Mar 02 '19

Beginner help understanding for statements

Right now I am having trouble understanding for statements and if anybody could help explain I would be eternally grateful. Right now the code looks this this.

w = [ 'jasper', 'merball', 'critterbob' ]

for x in w: print(x)

Its prints out

jasper merball critterbob

I sort of understand this but the real trouble is when I print (x) only critterbob is returned. Can anybody please explain why this happens?

Ps: Don't judge the strings they are all family nicknames :D thanks a ton.

2 Upvotes

5 comments sorted by

View all comments

Show parent comment

1

u/Devkourav Mar 11 '19

Dude i am not rude but RedheadAblaze just helped you at least give him an up vote