Question: (python program) Users: Make a class called User. Create two attributes called first_name and last_name, and then create several other attributes that are typically stored
(python program)
Users: Make a class called User. Create two attributes called first_name and last_name, and then create several other attributes that are typically stored in a user profile. Make a method called describe_user() that prints a summary of the user's information. Make another method called greet_user() that prints a personalized greeting to the user. Create several instances representing different users, and call both methods for each user. Admin: An administrator is a special kind of user. Write a class called Admin that inherits from the User class you created above. Add an attribute, privileges, that stores a list of strings like "can add post", "can delete post", "can ban user", and so on. Write a method called show_privileges() that lists the administrator's set of privileges. Create an instance of Admin. Privileges: Write a separate Privileges class. The class should have one attribute, privileges, that stores a list of strings. Move the show_privileges() method to this class. Make a Privileges instance as an attribute in the Admin class. Create a new instance of Admin and use your method to show its privileges
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
