How should I indent my code to create a new Animal object?


#1

Question

How should I indent my code to create a new Animal object?

Answer

Be sure you don’t indent your code that creates a zebra, otherwise it will be considered part of the Animal class code block. The code to create your zebra goes outside of any class code block, which means it will have no indentation.


FAQ: Learn Python - Introduction to Bitwise Operators - Instantiating Your First Object