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.
The reason of your problem is that you mix up, and seem to miss the difference, between numbers and digit characters. When you do
odd = [1,3,5,7,9]
, then the listodd
contains 5 numbers: 1, 3, 5, 7, and 9. When you donumber = list(str(sum(arr)))
, thenumber
list holds characters, for example:'1'
,'3'
,'5'
,'7'
, or'9'
. That's why when you donumber[-1] in odd
you get no results: because for example'5'
is not in[1, 3, 5, 7, 9]
.5
is, but'5'
is not. You need to find out what's the difference between'1'
and1
, or between'7'
and7
.Thank you for the solution
This comment is hidden because it contains spoiler information about the solution
Because it is not correct.
Without seeing your solution we do not know why it is not correct.
Why my solution doesn't work?
Thank you Polarish, that's important!