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.
So what I was missing (and that other guy's explanation fails to explain) is that when slicing a string to return a substring the : denotes a start and end point. s[] doesn't JUST return a specific indice. You can use it to return a substring from a starting indice to an ending indice. What the other guy is explaining is that the math works out so that on an odd string the equations on both sides of the : return the same number, so a string with 11 characters would be sliced starting at the 5th (starting from 0) indice and ending at the 5th indice. And even string length returns two different indices, so the one liner works.
I had to look this up, his explanation did not make sense to me at first either, and frankly I will always pefer easily readable functions to one liners like this in actual production.
oh, this made me feel dumb. Its so simple.
deleted
Check your alphabet, you have a typo there.
nothing's stopping you from using print to observe what is happening there.
Without seeing your code, we do not understand what is causing the error either.
I don't understand what is causing this error:
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 tests
test.assert_equals(printer_error(s), exp)
^^^^^^^^^^^^^^^^
File "/workspace/default/solution.py", line 34, in printer_error
if alphabet.get(letter) > 13:
^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: '>' not supported between instances of 'NoneType' and 'int'
all of the normal test cases pass just fine. The instructions state that the string will always be greater or equal to 1 in length, I covered every letter of the alphabet, and the instructions state the string will only include letters from a to z, so what could I possibly be missing?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Go to stack overflow if you want to actively be unhelpful.
why isn't that helping? is that still the information you're looking for or something else?
ask specific things. if you failed to google, then google better xd - include the language, avoid special characters
This comment is hidden because it contains spoiler information about the solution
from cursory googling, the integer.sum method only accepts two numbers as parameters. How does this work with the stream function?