I would prefer to use an extended class of string, it wil be much more reusable.
class Dots(str): def __init__(self, value: str): self.value = value def add_dots(self): return self.__class__(".".join(self.value)) def remove_dots(self): return self.__class__(".".replace(".", "")) msg = Dots("Hello") print(msg.add_dots()) print(msg.add_dots().lower())
It is very good, But in my case I did have to follow the instructions this is link of all challenges I work on it : pythonprinciples.com/challenges/
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I would prefer to use an extended class of string, it wil be much more reusable.
It is very good, But in my case I did have to follow the instructions
this is link of all challenges I work on it : pythonprinciples.com/challenges/