oop class in class python code example
Example 1: class and object in python
#NOTES
class PartyAnimal:
def Party():
#blahblah
an=PartyAnimal()
an.Party()# this is same as 'PartyAnimal.Party(an)'
Example 2: oop in python
class Object:
#__init__() is called when you create an Object class
def __init__(self,arg):
#stores argument in self
self.arg = arg
def printArg(self):
#calls argument from self
print(self.arg)