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

Зміст курсу

In-Depth Python OOP

Challenge: User Auth

Завдання

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.

Завдання

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.

Все було зрозуміло?

Секція 1. Розділ 8
toggle bottom row

Challenge: User Auth

Завдання

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.

Завдання

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.

Все було зрозуміло?

Секція 1. Розділ 8
toggle bottom row

Challenge: User Auth

Завдання

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.

Завдання

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.

Все було зрозуміло?

Завдання

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.

Секція 1. Розділ 8
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt