Question: Create person class that has attributes: first_name, last_name, and account. Make the account private. Put a comment at the top describing the class with the

Create person class that has attributes: first_name, last_name, and account. Make the account private.

Put a comment at the top describing the class with the sentence above.

Create function to print the data.

Create function to access the private data member.

Create 2 objects, one for yourself and another for a friend. Call them me and friend.

Print the results of the __doc__ function.

Print each of the objects.

Call the getter for the private data member with both objects.

Challenge:

  1. Automatically assign the account numbers for the accounts as 1 and 2 using a class attribute.

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 Programming Questions!