Force Negative
Write a function make_negative that takes number and returns its negative version. If the number is already negative or is zero, return it unchanged. An if statement with a < or > comparison will help.
Примеры
Ввод
1Вывод
-1Ввод
-5Вывод
-5Ввод
0Вывод
0Нужно реализовать
def make_negative(number: int) -> int:
Теги
math
Connectez-vous pour voir l'historique des soumissions
Se connecterConnectez-vous pour utiliser le Mentor IA
Se connecterTests12
Visible tests
Test caché 7
Test caché 8
Test caché 9
Test caché 10
Test caché 11
Test caché 12
They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.
Focus radio
Paused · SomaFM · Fluid