Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Thanks @hobovsky :) that makes sense!

  • Custom User Avatar

    How does solution show here if it cannot run here?

    This solution was posted when Python 2 was available. After Python 2 was removed this solution should become invalid, but for some kata, especially when it has really many solutions, some can survive invalidation process. They will be gradually disappearing though.

    Also why we need to mark a comment spoiler when discussing on a thread under a solution already out there?

    Home page dashboard displays all posts, even posted under solutions one cannot see.

  • Custom User Avatar

    Yes, about that since I am new here (literally couple of days). How does solution show here if it cannot run here? Can you post a solution here without running a solution? I don't see an option to post solution, I thought these are automatically added here once you have successfully solved a kata with that solution - if so then I don't see an option to choose python version.

    Also why we need to mark a comment spoiler when discussing on a thread under a solution already out there? If anyone can see the solution, they can run it and see the error as well - I don't see I am adding anything here that could be flagged as spoiler.

  • Custom User Avatar

    That's the point, that extra adjustment is not required. Below would work just fine:

    return sum(int(d) ** (i) for i, d in enumerate(str(a),1)) == a

  • Custom User Avatar

    That's a Python 2.7 solution, read the comment in the solution or the posts below, and don't forget to mark your post as having spoiler content next time, please.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution