oop python example
Example 1: 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)
Example 2: real python oop
>>> class Dog:
... pass
...
>>> a = Dog()
>>> type(a)
<class '__main__.Dog'>