Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: User Auth | 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

bookChallenge: User Auth

Task
test

Swipe to show code editor

Let's improve your User class!

  1. Create the class attribute is_authenticated in the User class.
  2. Define the login() method that takes arguments self and taken_password.
  3. The login() method should compare the user and taken passwords.
    If the user password is equal to the taken password, the True should be assigned to the is_authenticated attribute.
    If the user password is not equal to the taken password, the "Wrong password!" should be written in the console.
  4. Define the logout() methods. This method should assign the False value to the is_authenticated instance attribute.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 8
toggle bottom row

bookChallenge: User Auth

Task
test

Swipe to show code editor

Let's improve your User class!

  1. Create the class attribute is_authenticated in the User class.
  2. Define the login() method that takes arguments self and taken_password.
  3. The login() method should compare the user and taken passwords.
    If the user password is equal to the taken password, the True should be assigned to the is_authenticated attribute.
    If the user password is not equal to the taken password, the "Wrong password!" should be written in the console.
  4. Define the logout() methods. This method should assign the False value to the is_authenticated instance attribute.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 8
toggle bottom row

bookChallenge: User Auth

Task
test

Swipe to show code editor

Let's improve your User class!

  1. Create the class attribute is_authenticated in the User class.
  2. Define the login() method that takes arguments self and taken_password.
  3. The login() method should compare the user and taken passwords.
    If the user password is equal to the taken password, the True should be assigned to the is_authenticated attribute.
    If the user password is not equal to the taken password, the "Wrong password!" should be written in the console.
  4. Define the logout() methods. This method should assign the False value to the is_authenticated instance attribute.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Task
test

Swipe to show code editor

Let's improve your User class!

  1. Create the class attribute is_authenticated in the User class.
  2. Define the login() method that takes arguments self and taken_password.
  3. The login() method should compare the user and taken passwords.
    If the user password is equal to the taken password, the True should be assigned to the is_authenticated attribute.
    If the user password is not equal to the taken password, the "Wrong password!" should be written in the console.
  4. Define the logout() methods. This method should assign the False value to the is_authenticated instance attribute.

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Section 1. Chapter 8
Switch to desktopSwitch 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