Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Classify Numbers | R Conditional Statements Tutorial
Control Flow in R

bookChallenge: Classify Numbers

Compito

Swipe to start coding

Write a function that takes a single numeric input and returns a string indicating whether the number is "Positive", "Negative", or "Zero". Use if, else if, and else statements to determine the correct label.

  • If the input is greater than zero, return "Positive".
  • If the input is less than zero, return "Negative".
  • If the input is equal to zero, return "Zero".

Soluzione

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 1. Capitolo 2
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

bookChallenge: Classify Numbers

Scorri per mostrare il menu

Compito

Swipe to start coding

Write a function that takes a single numeric input and returns a string indicating whether the number is "Positive", "Negative", or "Zero". Use if, else if, and else statements to determine the correct label.

  • If the input is greater than zero, return "Positive".
  • If the input is less than zero, return "Negative".
  • If the input is equal to zero, return "Zero".

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 1. Capitolo 2
single

single

some-alt