How can I create a new Animal object and use its description method?


#1

Question

How can I create a new Animal object and use its description method?

Answer

Remember, creating a new object of a class looks like this:
object_name = ClassName("arguments_here")
Then, to use the description() method of our new Animal, we simply call that method attached to our new object, like this:
object_name.method_name()


FAQ: Learn Python - Introduction to Bitwise Operators - A Methodical Approach