Im trying to split the stings into even parts. For example if I have ['abcdef']
, expected output should be ['ab','cd','ef']
. I keep getting the same input for the first test 'asdfadsf'/
def solution(s):
lists = []
for i in s:
if len(s) % 2 == 0:
lists.append(s)
zip(*[iter(lists)]*2)
return lists
test.describe("Example Tests")
tests = (
("asdfadsf", ['as', 'df', 'ad', 'sf']),
("asdfads", ['as', 'df', 'ad', 's_']),
("", []),
("x", ["x_"]),
)
for inp, exp in tests:
test.assert_equals(solution(inp), exp)