Challenge: Parameter Practice
Uppgift
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".
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 4
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Fantastiskt!
Completion betyg förbättrat till 5.56
Challenge: Parameter Practice
Svep för att visa menyn
Uppgift
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".
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 4
single