Ad
  • Custom User Avatar

    But you can still get float to int variances that the kata cannot account for..

  • Custom User Avatar

    What the hell. This doesn't work! You get float values instead of integer values.

    How do you vote down solutions. This is broken and doesn't overcome the float to integer problem that python has and the solution has....

  • Custom User Avatar

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

  • Custom User Avatar

    If you're not returning anything, that's where the error comes from. (the tests receive None instead of expected list / array)

    To be clear, the error comes from calling sorted(None), and not from your code.

  • Custom User Avatar

    No, at this point I'm just testing the code, which runs fine in Jupyter.
    To be clear, there is code that's running after this, I'm just trying not to spoil the solution.
    I could pass and still get the same error, it seems like.

  • Custom User Avatar

    Are you returning None?

  • Custom User Avatar

    I'm getting this error no matter what I do:

    I'm simply trying to iterate through the sting, line 3 here is something like:
    for variable in range(len(string)):
    I got the same when I did this as a list complrehension.

    Traceback (most recent call last):
    File "tests.py", line 3, in
    test.assert_equals(sorted(permutations('a')), ['a']);
    TypeError: 'NoneType' object is not iterable