You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Understand what the interviewer is asking for by using test cases and questions about the problem.
What steps are necessary to create an instance of a class and use its methods?
First, create an instance by providing the required attributes.
Second, use the class methods by calling them on the instance.
P-lan
Plan the solution with appropriate visualizations and pseudocode.
General Idea: Instantiate an object of the class Pokemon and then call a method on this instance to perform an action.
1) Create an instance named `squirtle` with name "Squirtle" and types ["Water"] using the Pokemon class constructor.
2) Call the `print_pokemon()` method on the `squirtle` instance to display the properties of the Pokemon.
⚠️ Common Mistakes
Incorrect instantiation of the object without passing all required parameters to the constructor.