Python for loops

Hey guys, I have one question about for loops. In case below there needs to be index next to the word as word[0]. If there is not code does’t work proppertly. Why is it? In the for loop does this index automaticaly bigger by each loop? So it goes like 0 on first loop, 1 on second, 2 on third and so on?

words = ["@coolguy35", "#nofilter", "@kewldawg54", "reply", "timestamp", "@matchamom", "follow", "#updog"]
usernames = []

for word in words:
  if word[0] == '@':

word contains the value from the list,Then you want to check if the first letter of each string is a @ symbol.

so the [0] has nothing to do with looping over the list, it simply gives us the first letter of the string.

1 Like

Got it.

You are python legend.