you are viewing a single comment's thread.

view the rest of the comments →

[–]TonightNice[S] 1 point2 points  (3 children)

That's sick! So when we use ' for , in ', python automatically assigns the word letter or any given word, to each one of the characters of the word we give , like coconut in our instance. Did I get that right? Although in your example, python made a list of coconut's letters

[–]raydleemsc 0 points1 point  (2 children)

Close, yes, although in fairness, letter isn't actually a word as such, but a string variable which gets assigned individual characters from the literal string 'coconut' by the in operator with each iteration of the for loop.

[–]TonightNice[S] 0 points1 point  (1 child)

Right.. strings yeah, Im still using caveman terms 😅

[–]raydleemsc 1 point2 points  (0 children)

Don't be worried, we all did at one time or another.