Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Citizen():
- type='Citizen'
- colony='init'
- def __init__(self,value1,value2):
- self.name=value1
- self.gender=value2
- def __iter__(self):
- return iter(self.name)
- def print_citizen(self,colonyname):
- for i in self.Citizen:
- if (Citizen.colony==colonyname) :
- print(i.name,' | Citizen | ',i.gender)
- for i in self.Citizen:
- AttributeError: 'str' object has no attribute 'Citizen'
Add Comment
Please, Sign In to add comment