Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Admin | Inheritance
In-Depth Python OOP
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: Admin

Завдання

You have a User class from the last challenge.
The methods are corrected (User -> {self.username} in strings).
Let's define the Admin class!

  1. Define the Admin class inherited from the User class.
  2. Define the create_content() admin's method that prints the string:
    f"{self.username} creates the content".
  3. Define the update_content() admin's method that prints the string:
    f"{self.username} updates the content".
  4. Define the delete_content() admin's method that prints the string:
    f"{self.username} deletes the content".

Note

Admin has all the capabilities of User that do not need to be reimplemented. This is an example of how inheritance makes our life easier.

Завдання

You have a User class from the last challenge.
The methods are corrected (User -> {self.username} in strings).
Let's define the Admin class!

  1. Define the Admin class inherited from the User class.
  2. Define the create_content() admin's method that prints the string:
    f"{self.username} creates the content".
  3. Define the update_content() admin's method that prints the string:
    f"{self.username} updates the content".
  4. Define the delete_content() admin's method that prints the string:
    f"{self.username} deletes the content".

Note

Admin has all the capabilities of User that do not need to be reimplemented. This is an example of how inheritance makes our life easier.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

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

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

Challenge: Admin

Завдання

You have a User class from the last challenge.
The methods are corrected (User -> {self.username} in strings).
Let's define the Admin class!

  1. Define the Admin class inherited from the User class.
  2. Define the create_content() admin's method that prints the string:
    f"{self.username} creates the content".
  3. Define the update_content() admin's method that prints the string:
    f"{self.username} updates the content".
  4. Define the delete_content() admin's method that prints the string:
    f"{self.username} deletes the content".

Note

Admin has all the capabilities of User that do not need to be reimplemented. This is an example of how inheritance makes our life easier.

Завдання

You have a User class from the last challenge.
The methods are corrected (User -> {self.username} in strings).
Let's define the Admin class!

  1. Define the Admin class inherited from the User class.
  2. Define the create_content() admin's method that prints the string:
    f"{self.username} creates the content".
  3. Define the update_content() admin's method that prints the string:
    f"{self.username} updates the content".
  4. Define the delete_content() admin's method that prints the string:
    f"{self.username} deletes the content".

Note

Admin has all the capabilities of User that do not need to be reimplemented. This is an example of how inheritance makes our life easier.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

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

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

Challenge: Admin

Завдання

You have a User class from the last challenge.
The methods are corrected (User -> {self.username} in strings).
Let's define the Admin class!

  1. Define the Admin class inherited from the User class.
  2. Define the create_content() admin's method that prints the string:
    f"{self.username} creates the content".
  3. Define the update_content() admin's method that prints the string:
    f"{self.username} updates the content".
  4. Define the delete_content() admin's method that prints the string:
    f"{self.username} deletes the content".

Note

Admin has all the capabilities of User that do not need to be reimplemented. This is an example of how inheritance makes our life easier.

Завдання

You have a User class from the last challenge.
The methods are corrected (User -> {self.username} in strings).
Let's define the Admin class!

  1. Define the Admin class inherited from the User class.
  2. Define the create_content() admin's method that prints the string:
    f"{self.username} creates the content".
  3. Define the update_content() admin's method that prints the string:
    f"{self.username} updates the content".
  4. Define the delete_content() admin's method that prints the string:
    f"{self.username} deletes the content".

Note

Admin has all the capabilities of User that do not need to be reimplemented. This is an example of how inheritance makes our life easier.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів

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

Завдання

You have a User class from the last challenge.
The methods are corrected (User -> {self.username} in strings).
Let's define the Admin class!

  1. Define the Admin class inherited from the User class.
  2. Define the create_content() admin's method that prints the string:
    f"{self.username} creates the content".
  3. Define the update_content() admin's method that prints the string:
    f"{self.username} updates the content".
  4. Define the delete_content() admin's method that prints the string:
    f"{self.username} deletes the content".

Note

Admin has all the capabilities of User that do not need to be reimplemented. This is an example of how inheritance makes our life easier.

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