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.
@brodiemark, that error message is both accurate and fair. You defined a repr that is indistinguishable from int and then your complaint is that your repr is indistinguishable from int. It's also explicitly stated in repr's docs that you shouldn't do that.
Okay, I see. Thank you.
Your solution returns the number passed in, so
add(1)
returns1
- if you then doadd(1)(2)
, you're trying to call the number1
as a function, which causes the error.Can not run it in Python 3.11, I just keep getting this error:
Unexpected exception raised
Traceback (most recent call last):
File "/workspace/default/.venv/lib/python3.11/site-packages/codewars_test/test_framework.py", line 112, in wrapper
func()
File "/workspace/default/tests.py", line 8, in _
test.assert_equals(add(1)(2), 3)
^^^^^^^^^
TypeError: 'int' object is not callable
This comment is hidden because it contains spoiler information about the solution
Hahah what is this solution
This was smart