Ad
  • Default User Avatar

    I think this is the first test that uses a unicode marker - might want to check your solution handles unicode?

  • Default User Avatar

    Failing test on a unicode character - probably worth mentioning that the comment marker may be unicode, especially in python as current codewars version of python (2.7) has poor unicode support. I also think quite a few people won't expect a unicode comment marker.

  • Default User Avatar

    Yea, they're initiating correctly. My guess is that you're trying to refer to a global variable instead of encapsulating the key and alphabet in the constructor.

  • Default User Avatar

    Python - my code works in the initial tests, but on hitting submit:

    Testing with lowercase latin alphabet
    Password of 'password'
    Traceback:
    in
    in encode
    NameError: global name 'key' is not defined

    Are the tests initiating the test data correctly?

  • Custom User Avatar

    No problem. I'm hoping that Codewars will support Python 3 in the future.

    Also, when you click Train on a kata it says "Supported Python version is 2.7.6" at the bottom of the Instructions tab.

  • Default User Avatar

    That was what I wondered, I just failed to find a reference to the environment set up. I'll adjust and see if I can fix. Thanks!

  • Custom User Avatar

    Could it be because Codewars uses Python 2.7?

    # Python 2
    >>> 1 / 3
    0
    >>> 1 / float(3)
    0.3333333333333333
    
    # Python 3
    >>> 1 / 3
    0.3333333333333333
    >>> 1 // 3
    0
    

    http://www.codewars.com/docs/python-environment

    http://www.informit.com/articles/article.aspx?p=1439189

  • Default User Avatar

    Finding some really weird things going with this in python. I have a script that works perfectly when run in python 3.4, but the tests retrun all sorts of strange errors. Doing a little playing I note that python here versus on the desktop executes some math slightly differently for example var = tn/n where tn=1 and n=3 as integers in python on my workstation var=0.3333333333, here it returns 0.