Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Parameter Practice | Writing Functions in R
Functions and Functional Programming in R

bookChallenge: Parameter Practice

Завдання

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".

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 4
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Suggested prompts:

Can you explain this in simpler terms?

What are the main benefits or drawbacks?

Can you give me a real-world example?

close

bookChallenge: Parameter Practice

Свайпніть щоб показати меню

Завдання

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".

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 4
single

single

some-alt