セクション 4. 章 7
single
Challenge: AbstractAdmin
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
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
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください