Sektion 1. Kapitel 4
single
Challenge: Using init and self in Classes
Stryg for at vise menuen
Opgave
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.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 4
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat