Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Default Arguments in Action | Writing Functions in R
Functions and Functional Programming in R

bookChallenge: 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: width and height, with height defaulting to 1.
  • The function must return the product of width and height.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 6
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

bookChallenge: 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: width and height, with height defaulting to 1.
  • The function must return the product of width and height.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 6
single

single

some-alt