Challenge: Classify Numbers
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".
Ratkaisu
Kiitos palautteestasi!
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Can you explain this in simpler terms?
What are the main points I should remember?
Can you give me an example?
Mahtavaa!
Completion arvosana parantunut arvoon 5.56
Challenge: Classify Numbers
Pyyhkäise näyttääksesi valikon
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".
Ratkaisu
Kiitos palautteestasi!
single