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
Kirjaudu sisään nähdäksesi palautushistorian
Kirjaudu sisäänKirjaudu sisään käyttääksesi tekoälymentoria
Kirjaudu sisäänTests12
Visible tests
Piilotettu testi 7
Piilotettu testi 8
Piilotettu testi 9
Piilotettu testi 10
Piilotettu testi 11
Piilotettu testi 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