Ad
  • Custom User Avatar

    if you write a solution in python, you should consider slice instead of using s[-1].
    However, it is just a temprary solution to avoid that error, so let me know if you got a better solution.

  • Default User Avatar

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

  • Custom User Avatar

    Please mark your post as having spoiler content next time.

  • Custom User Avatar

    See the example in the description, the input is not in the error message, the first value is your wrong answer, the one with less spaces in it and the second one is the expected answer, with double spaces.
    This is the test:

    #                                     input value          expected reversed value
    test.assert_equals(reverse_words('double  spaced  words'), 'elbuod  decaps  sdrow')
    
  • Custom User Avatar

    The error message is:

    'elbuod decaps sdrow'     should equal 
    'elbuod  decaps  sdrow'
    

    Your solution does not preserve adjacent spaces.