Challenge: 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
num1tonum2. - If
num1is greater thannum2, return a string in the format "num1 is greater than num2". - If
num1is less thannum2, return a string in the format "num1 is less than num2". - If
num1is equal tonum2, return a string in the format "num1 is equal to num2".
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 1. Chapitre 4
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion
Génial!
Completion taux amélioré à 5.56
Challenge: 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
num1tonum2. - If
num1is greater thannum2, return a string in the format "num1 is greater than num2". - If
num1is less thannum2, return a string in the format "num1 is less than num2". - If
num1is equal tonum2, return a string in the format "num1 is equal to num2".
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 1. Chapitre 4
single