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.
using modulo is slower than testing the LSB.
Auto-approved after elapsed grace-period.
This comment is hidden because it contains spoiler information about the solution
oh thank you i could not understand where is the problem now i solved it , thank you dear!
You are not supposed to return 0 (an integer, which is not iterable, as the error says). You are supposed to return two lists.
i got this error when list is empty or there is one number in list,so i tried to fix it with if lst == [] or len(lst) ==1 return 0 but it doesnt return 0 ,though in pycharm it returns 0,here i got this error,dont know how to fix can anyone help?
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 47, in _
test_split_list([], 0)
File "/workspace/default/tests.py", line 9, in test_split_list
a, b = split_list(xs[:])
^^^^
TypeError: cannot unpack non-iterable int object
Python:
If this version of the kata is not supposed to be solveable by the bruteforce version applicable in the easy kata, then the tests need to be hardened (see my solution, which passed).
It passes roughly 10% of attempts (by stumbling on an optimal solution early, if one exists)
That means you are returning more than 2 lists.
I get the following error on each data set
, although my code works perfectly on Python 10.x using PyCharm.
Testing [2, 3, 4, 6, 8, 2]
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 37, in _
test_split_list(xs, best)
File "/workspace/default/tests.py", line 6, in test_split_list
a, b = split_list(xs[:])
^^^^
ValueError: too many values to unpack (expected 2)
Completed in 2.66ms
This comment is hidden because it contains spoiler information about the solution
Rust translation ready for review.
Gandolf approved.
Python fork updating to new test framework amongst other improvements.
This comment is hidden because it contains spoiler information about the solution
Please use spoiler flag next time.
Loading more items...