Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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:
- 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started