Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
doesn't "elif n is None:" cover that tho?
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.
I still can't figure it out...
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'