Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Surround the thing you're appending in brackets: I think you're doing
.append(x for x...)
, but it should be.append([x for x...])
. The first is generator expression, and the second one is a list.I declared new_names in the first line I believe and you were right append returns None so that's where that came from. But let's say I did not assign new_names = new_names.append(...) and instead i just did new_names.append(...) I still get an error in the second to last line saying I can't concatonate generator objects... what is that? There is something I am not getting on why the two methods don't do the the same thing
Well, I don't see where you declared
new_names
, so it's not surprising. But ok, let's say you did. Then,new_names = new_names.append(...)
- I really don't know how this should work, and it probably doesn't. My guess is that.append()
returnsNone
, so you re-assignednew_names
toNone
.Yeah I was just printing it for debugging purposes. You can see the rest of my solution,but when I go on to iterate through new_names after using the second method it doesn't work because it is a NoneType
You need to return the result, not print it.
This comment is hidden because it contains spoiler information about the solution