Ad
  • Custom User Avatar

    Please read how to post code in Discourse, it's the last link I posted, without formatting, the indentation and some other things are lost and it's hard to read. There is no need now, you don't need to post your working code, just for the next time you ask for help.

  • Custom User Avatar
  • Default User Avatar

    Usually this is caused because you haven't set up your local environment to match the one on codewars, or you are running tests in a different way. For example, on this kata, there is a reason that your code appears to work locally and it will not work on codewars. On codewars, your code is loaded one time and then it is run over and over again, one test after another. If you test your code locally, you are likely only doing one test at a time. So, locally, try to do this:

    #your solution here
    
    #make sure both of these tests are done in one "run" of your code
    print(number(["a", "b", "c"]))
    print(number(["d", "e", "f"]))
    
    

    I'm willing to bet that you get the correct answer for the first call of your function, but not the second call.