Methods are functions defined inside the body of a class. They are used to define the behaviors of an object.
# With parameters
def speak(self, sound):
return "{} says {}".format(self.name, sound)
# Without parameters
def description(self):
return "{} is {} years old".format(self.name, self.age)
# Call method without parameters
print(mikey.description())
# Call method with parameters
print(mikey.speak("Gruff Gruff"))