Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: User | OOP Concepts
In-Depth Python OOP
course content

Course Content

In-Depth Python OOP

In-Depth Python OOP

1. OOP Concepts
2. Inheritance
3. Encapsulation
4. Polymorphism and Abstraction
5. Magic Methods

Challenge: User

Task

  1. Define the User class by the class keyword.
  2. 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.
  3. The __init__ method should assign arguments to the instance attributes via the self keyword.
  4. Create the bob instance of the User class with any username and password.

Once you've completed this task, click the button below the code to check your solution.

Task

  1. Define the User class by the class keyword.
  2. 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.
  3. The __init__ method should assign arguments to the instance attributes via the self keyword.
  4. Create the bob instance of the User class with any username and password.

Once you've completed this task, click the button below the code to check your solution.

Switch to desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

Section 1. Chapter 5
toggle bottom row

Challenge: User

Task

  1. Define the User class by the class keyword.
  2. 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.
  3. The __init__ method should assign arguments to the instance attributes via the self keyword.
  4. Create the bob instance of the User class with any username and password.

Once you've completed this task, click the button below the code to check your solution.

Task

  1. Define the User class by the class keyword.
  2. 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.
  3. The __init__ method should assign arguments to the instance attributes via the self keyword.
  4. Create the bob instance of the User class with any username and password.

Once you've completed this task, click the button below the code to check your solution.

Switch to desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

Section 1. Chapter 5
toggle bottom row

Challenge: User

Task

  1. Define the User class by the class keyword.
  2. 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.
  3. The __init__ method should assign arguments to the instance attributes via the self keyword.
  4. Create the bob instance of the User class with any username and password.

Once you've completed this task, click the button below the code to check your solution.

Task

  1. Define the User class by the class keyword.
  2. 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.
  3. The __init__ method should assign arguments to the instance attributes via the self keyword.
  4. Create the bob instance of the User class with any username and password.

Once you've completed this task, click the button below the code to check your solution.

Switch to desktop for real-world practiceContinue from where you are using one of the options below

Everything was clear?

Task

  1. Define the User class by the class keyword.
  2. 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.
  3. The __init__ method should assign arguments to the instance attributes via the self keyword.
  4. Create the bob instance of the User class with any username and password.

Once you've completed this task, click the button below the code to check your solution.

Switch to desktop for real-world practiceContinue from where you are using one of the options below
Section 1. Chapter 5
Switch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt