Here is some Ruby code:
class Duck
def help
puts \"Quaaaaaack!\"
end
end
class Person
def help
puts \"Heeeelp!\"
end
end
def InTheForest x
When you are defining a method in Python, you have to provide the object on which it applies, which, in your case, is self
.
Therefore you have to adapt your code with the following line to have the expected behaviour:
class Duck:
def help(self):
print("Quaaaaaack!")
class Person:
def help(self):
print("Heeeelp!")