class Person: def __init__(self,name, age): self.__name = name self.__age = age def __str__(self): return("%s is %s years old" %(self.__name,self.__age)) @classmethod def from_string(cls,person_str): l=person_str.split(",") cls.__name=l[0] cls.__age=int(l[1]) p=Person(cls.__name,cls.__age) return(p)