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.
i added the
@staticmethod
decorator to make things clearerWhen using Python class and declaring methods with class scope, you need add @classmethod above the method declaration and add 'cls' to the beginning of method signature. Also remember to put the class name before all the class variables that used inside the given method
@classmethod
def from_roman(cls, roman)
i have the very same problem as mdczaplicki and i don't get your answer, csc4pg. can you write down, how the definition of functions should look like? i mean, instead of
def to_roman(self, n):
def from_roman(self, s):
is what exactly supposed to be on that lines? and don't tell me that would be spoiler, it's a manner of understanding the quest, you tell me no algorithm by that...
Think about what you are returning, in this case it's an integer, and the tests are trying to call a function
Because you have 'self' as one of the arguments to your methods, it requires an instance of the class to run.
Additionally, because codewars uses an old version of python, to run static methods, you need to have @staticmethod above your static method definitions