Challenge: Default Arguments in Action
Uppgift
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ösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 6
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Fantastiskt!
Completion betyg förbättrat till 5.56
Challenge: Default Arguments in Action
Svep för att visa menyn
Uppgift
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ösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 6
single