Ad
  • Custom User Avatar

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

  • Custom User Avatar

    You're making a function that will be called a number of times. All your code should (in 99% of cases) be contained inside this function. Any global variables retain state between calls.

  • Custom User Avatar

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

  • Custom User Avatar

    Many thanks!!!

  • Default User Avatar

    You shouldn't use input on Codewars in general. A number will be fed to your function in the tests. Just assume that function will receive the necessary parameters to execute without having the user entering any kind of number. Hope this helps! If you reset your solution, you should use "n" as the number who will be necessary to code your solution.

  • Custom User Avatar

    Hello everyone,

    New to CodeWars and relatively new to (python) programming. I think the site has huge potential to help people like me with their programming skills, however, I seem to have stumbled at the first hurdle. I tried to use a very simple "input()" command and when I press the test button to test I get an end of line error. When I run the same code in another python editor, external to CodeWars, the command works and no error is produced. Any advice please? It feels that this may be something fundamentaly wrong with the way I am using the site and its resources. The code I tried to run was: number = input('Enter your number:'), many thanks!