Question: in python: Create an instance of the Person class from exercise 1. Use the dir function on the instance. Then use the dir function on

in python:

Create an instance of the Person class from exercise 1. Use the dir function on the instance. Then use the dir function on the class. What happens if you call the __str__ method on the instance? Verify that you get the same result if you call the str function with the instance as a parameter. What is the type of the instance? What is the type of the class? Write a function which prints out the names and values of all the custom attributes of any object that is passed in as a parameter. (see vars() hint.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!