Ad
  • Custom User Avatar

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

  • Custom User Avatar

    I trying the duplicate_encode kata for Python.

    Despite all test are ok, when trying the final attemp it gives me an error in the last test, it returns:

     '))(()())())' should equal '()(((())())'
    

    My code is:

     def duplicate_encode(word):
       nword=''
       for c in word.lower():nword+='(' if word.count(c)==1 else ')' 
       return nword
    

    I do not have feedback of the input that gives error. Can someone help me please?

    Thanks.