for word in words:
if word[0] == ‘@’:
usernames.append(word)
It looks backwards to me, i don't understand :)
Are we adding'@' to the start of a username?
for word in words:
if word[0] == ‘@’:
usernames.append(word)
It looks backwards to me, i don't understand :)
Are we adding'@' to the start of a username?
Ah damn i should write clearer eh eh!
Maybe :P
You can still explain further here also?!
even though you are clearly making fun of me xD let me entertain you.
They wanted us to create a list of the usernames mentioned in a list of strings. The loop checks the first indice of each string for “@“ which indicate a username in that list (^^;)
Whenever the loop finds such a string, it adds it to a different list. The one made only for usernames.
Better? xD
Yes that is better :)
Not much code to traverse a string, hunt for usernames, and add to a new list!
so the string could be 'nope, @abh12345, dggggg@ned'?
will ned (with @) still get moved to the new list?
❌ that won’t work because “@“ has to be at index 0 for the string to be deemed a username 💮
so is the first list an array of strings, some are usernames and some aren't?
Yep :)