Course Content
In-Depth Python OOP
In-Depth Python OOP
4. Polymorphism and Abstraction
Challenge: User
Task
Swipe to begin your solution
- Define the
User
class by theclass
keyword. - The
User
class should have the__init__
method that takes 3 arguments:
self
- an instance of the class.
username
- user's username.
password
- user's password. - The
__init__
method should assign arguments to the instance attributes via theself
keyword. - Create the
bob
instance of theUser
class with any username and password.
Once you've completed this task, click the button below the code to check your solution.
Solution
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 5
Challenge: User
Task
Swipe to begin your solution
- Define the
User
class by theclass
keyword. - The
User
class should have the__init__
method that takes 3 arguments:
self
- an instance of the class.
username
- user's username.
password
- user's password. - The
__init__
method should assign arguments to the instance attributes via theself
keyword. - Create the
bob
instance of theUser
class with any username and password.
Once you've completed this task, click the button below the code to check your solution.
Solution
Switch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 5
Switch to desktop for real-world practiceContinue from where you are using one of the options below