Ad
  • Custom User Avatar

    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 list odd contains 5 numbers: 1, 3, 5, 7, and 9. When you do number = list(str(sum(arr))), the number list holds characters, for example: '1', '3', '5', '7', or '9'. That's why when you do number[-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' and 1, or between '7' and 7.

  • Custom User Avatar

    To keep indentation, you need to use code formatting markdown.

  • Custom User Avatar

    Because it is not correct.

    Without seeing your solution we do not know why it is not correct.