Facebook
From your papa, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 146
  1. class Person:
  2.     def __init__(self,name, age):
  3.         #fill your code
  4.         self.__name=name
  5.         self.__age=age
  6.    
  7.                
  8.     @classmethod
  9.     def from_string(cls, person_str):
  10.                 #fill your code
  11.         a,b=map(str,person_str.split(','))
  12.         return '{} is {} years old'.format(a,b)
  13.        
  14.     def __str__(self):
  15.                 #fill your code
  16.         return '{} is {} years old'.format(self.__name,self.__age)
  17.        
  18.  
  19.  
  20.        
  21.                
  22.  
  23.                
  24.                
  25.