Facebook
From Idiotic Anoa, 5 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 49
  1. class Person:
  2.        
  3.     def __init__(self,name, age):
  4.             self.__name = name
  5.             self.__age = age
  6.    
  7.     def __str__(self):
  8.         return (self.__name+" is "+str(self.__age)+" years old")
  9.                
  10.     def __eq__(self,other):
  11.         if self.__name==other.__name and self.__age==other.__age:
  12.             return True
  13.         else:
  14.             return False
  15.