Challenge: Default Arguments in Action
Tehtävä
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.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 6
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Mahtavaa!
Completion arvosana parantunut arvoon 5.56
Challenge: Default Arguments in Action
Pyyhkäise näyttääksesi valikon
Tehtävä
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.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 6
single