Facebook
From Queen Moth, 5 Months ago, written in Plain Text.
This paste is a reply to 6class from Mungo Cassowary - view diff
Embed
Download Paste or View Raw
Hits: 62
  1. class Address:
  2.     def __init__(self,street, city, state):
  3.         self.__street = street
  4.         self.__city = city
  5.         self.__state = state
  6.     def __str__(self):
  7.         return(self.__street+" , "+self.__city+" , "+self.__state)
  8.        
  9.        
  10.        
  11. from Address import Address
  12. class Person:
  13.     def __init__(self,name, age, address):
  14.         self.__name = name
  15.         self.__age = age
  16.         self.__address = address
  17.     def __str__(self):
  18.         return(self.__name+" is a person who is "+str(self.__age)+" years old and lives in the following address : "+str(self.__address))  
  19.        
  20.        
  21.