Description problems in course material

By the way, yet again - broken exercise even in discription!

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

for word in words:
  if word[0] == '@':
    usernames.append(word)
    print(usernames)
    
    usernames = [word for word in words if word[0] == '@']

RESULTS:

['@coolguy35']
['@coolguy35', '@kewldawg54', '@matchamom', '@kewldawg54']
['@coolguy35', '@kewldawg54', '@matchamom', '@matchamom']

Are you kidding?

The description is fine, but its important to put the piece together correctly.

you want to print the usernames after the loop:

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

for word in words:
  if word[0] == '@':
    usernames.append(word)

# place print statement outside/after the loop
print(usernames)

see? works fine.

Why would you want to have the print statement within the loop? You want to gather the usernames first, before printing them

1 Like

Try to print both descriptions separately and you get same issue.

I repeat - starting from Loops clause course has number of issues mostly in description part, when student simply don’t know what to you want from him. Especially it happens with math formulas - several times i was frustrated by what you mean as sum - (+, += or sum); same with word “equal” - did you meat = or ==? “Second to last” also have three different uses in course what breaks my mind.
Just now, in String section, you use word “index” for single index and word “indeces” for multiple. Huh.

Finally, Loops section don’t contain clear description of for / while / break structure without any addition. It has superstructure everywhere. When i just need simple:
For x in y:
instructions
print()
while y in x
instructions
break
print()

…of course, i understook what i sit down and with help of sweat, swearing and Baba Yaga write it personally, but this methof of education frustrating a lot.