Challenge: Default Arguments in Action
Aufgabe
Swipe to start coding
Write a function rectangle_area that calculates the area of a rectangle, with the height defaulting to 1 if not provided.
- The function must take two parameters:
widthandheight, withheightdefaulting to 1. - The function must return the product of
widthandheight.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 1. Kapitel 6
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Großartig!
Completion Rate verbessert auf 5.56
Challenge: Default Arguments in Action
Swipe um das Menü anzuzeigen
Aufgabe
Swipe to start coding
Write a function rectangle_area that calculates the area of a rectangle, with the height defaulting to 1 if not provided.
- The function must take two parameters:
widthandheight, withheightdefaulting to 1. - The function must return the product of
widthandheight.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 1. Kapitel 6
single