Section 1. Chapter 4
single
Challenge: Using init and self in Classes
Swipe to show menu
Task
Swipe to start coding
- Define a class called
Book. - The class should have an
__init__method that takes three parameters:self,title, andauthor. - Initialize the
titleandauthorattributes usingself.
Solution
Everything was clear?
Thanks for your feedback!
Section 1. Chapter 4
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat