Challenge: AbstractAdmin
Завдання
Swipe to start coding
Let's protect your Admin class structure! You need to define the AbstractAdmin class that should have the strict Admin class structure.
- Import the
ABCclass andabstractmethoddecorator from theabcpackage. - Define the
AbstractAdminclass inherited from theABCclass. - Define the abstract methods
login(),logout(),create_content(),update_content(), anddelete_content()via the@abstractmethoddecorator.
Use thepasskeyword to miss the function implementation. - Inherit the
Adminclass from theAbstractAdminclass. - Try to run the code with comments. Look at the Traceback.
- Delete comments in the
Adminclass and run the code again.
Note
Abstract methods should not receive arguments.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 4. Розділ 7
single
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Suggested prompts:
Сумаризуйте цей розділ
Пояснити код у file
Пояснити, чому file не вирішує завдання
Awesome!
Completion rate improved to 2.78
Challenge: AbstractAdmin
Свайпніть щоб показати меню
Завдання
Swipe to start coding
Let's protect your Admin class structure! You need to define the AbstractAdmin class that should have the strict Admin class structure.
- Import the
ABCclass andabstractmethoddecorator from theabcpackage. - Define the
AbstractAdminclass inherited from theABCclass. - Define the abstract methods
login(),logout(),create_content(),update_content(), anddelete_content()via the@abstractmethoddecorator.
Use thepasskeyword to miss the function implementation. - Inherit the
Adminclass from theAbstractAdminclass. - Try to run the code with comments. Look at the Traceback.
- Delete comments in the
Adminclass and run the code again.
Note
Abstract methods should not receive arguments.
Рішення
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 4. Розділ 7
single