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

bookChallenge: Default Arguments in Action

Oppgave

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.

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 6
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

close

bookChallenge: Default Arguments in Action

Sveip for å vise menyen

Oppgave

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.

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 6
single

single

some-alt