External Exam Download Resources Web Applications Games Recycle Bin

Class, Instance and Method

my first oop code.py

class Dog:
  def bark(self): 
      print("Woof")

fido = Dog() #instance object
spot = Dog() 
fido.bark()  #method
spot.bark()