Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Parameter Practice | Writing Functions in R
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Functions and Functional Programming in R

bookChallenge: Parameter Practice

Tâche

Swipe to start coding

Write a function compare_numbers that takes two numbers as input and returns a string stating whether the first is greater than, less than, or equal to the second.

  • Compare the value of num1 to num2.
  • If num1 is greater than num2, return a string in the format "num1 is greater than num2".
  • If num1 is less than num2, return a string in the format "num1 is less than num2".
  • If num1 is equal to num2, return a string in the format "num1 is equal to num2".

Solution

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 4
single

single

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

close

bookChallenge: Parameter Practice

Glissez pour afficher le menu

Tâche

Swipe to start coding

Write a function compare_numbers that takes two numbers as input and returns a string stating whether the first is greater than, less than, or equal to the second.

  • Compare the value of num1 to num2.
  • If num1 is greater than num2, return a string in the format "num1 is greater than num2".
  • If num1 is less than num2, return a string in the format "num1 is less than num2".
  • If num1 is equal to num2, return a string in the format "num1 is equal to num2".

Solution

Switch to desktopPassez à un bureau pour une pratique réelleContinuez d'où vous êtes en utilisant l'une des options ci-dessous
Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 1. Chapitre 4
single

single

some-alt