LScarpinati

nested classes in python

Dec 31st, 2015
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.15 KB | None | 0 0
  1. class WellKnownCharacter:
  2.     name = ""
  3.    
  4.     class Mouse():
  5.         name = "Mickey"
  6.  
  7.     class Duck():
  8.         name = "Donald"
  9.  
  10.     def getName(self):
  11.         return self.name
Advertisement
Add Comment
Please, Sign In to add comment