Session Ready
Exercise

Exploring object interface

The best way to learn how to write object-oriented code is to study the design of existing classes. You've already learned about exploration tools like type() and dir().

Another important function is help(): calling help(x) in the console will show the documentation for the object or class x.

Most real world classes have many methods and attributes, and it is easy to get lost, so in this exercise, you will start with something simpler. We have defined a class, and created an object of that class called mystery. Explore the object in the console using the tools that you learned.

Instructions 1/3
undefined XP
  • 1
  • 2
  • 3

Question

What class does the mystery object have?

Possible Answers