Ad
  • Custom User Avatar

    "contiguous subsequence" is not a mistake, it's a shortcut to say all elements of the subsequence are contiguous in the sequence.

  • Default User Avatar

    and since no-one wants to guess at indentation, use proper markdown formatting

  • Default User Avatar

    Hi, don't post code without the spoiler tag or everyone can see it (I have added the tag).

  • Default User Avatar

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

  • Default User Avatar

    doesn't "elif n is None:" cover that tho?

  • Custom User Avatar

    You need to handle the case when no argument is given.

  • Default User Avatar

    def arr(n):
    x = []
    if n == 0:
    return []
    elif n is None:
    return []
    else:
    for i in range(n):
    x.append(i)
    return x
    '''
    Traceback (most recent call last):
    File "/workspace/default/src/codewars-test/codewars_test/test_framework.py", line 111, in wrapper
    func()
    File "tests.py", line 7, in basic_tests
    test.assert_equals(arr(), [])
    TypeError: arr() missing 1 required positional argument: 'n'

    '''
    I don't understand the error with my code above.

  • Default User Avatar

    There are strings with non-ASCII characters in Rust. There are no such characters in other languages and it's not possible to solve this task in general without detailed specifications (can there be decomposed characters? characters that aren't mapped one to one when changing case? what language/locale is it? "I" needs special handling in Turkish, "Σ" needs special handling when it's the last letter...)

  • Custom User Avatar

    It means that your solution does not work when called like this: hello() i.e. without parameters.

    It should work when called with either one param (hello("Steve")) or without params (hello()).

  • Default User Avatar

    I still can't figure it out...

  • Custom User Avatar

    Read the posts below asking the same.

  • Default User Avatar

    What does the following error mean?
    Traceback (most recent call last):
    File "main.py", line 14, in
    test.assert_equals(hello(), "Hello, World!")
    TypeError: hello() missing 1 required positional argument: 'name'