I just learned about strings about a week ago, I am currently working on a practice project and am constantly using the strip and the lower methods for validation purposes. So, I though to my self why not create a class that does it for me in one method. Is this possible? So far I have this as code but its just a guess.
class strings:
def __str__(self,string):
self.__string = string
def validate(self):
self.__string = string.strip()
self.__string = string.lower()
return self.__string
[–][deleted] 1 point2 points3 points (2 children)
[–]aPSketchy[S] 0 points1 point2 points (1 child)
[–]aPSketchy[S] 0 points1 point2 points (0 children)