Force Negative
Sometimes calculations need a number to be non-positive, such as for a charge, deduction, or negative adjustment. Write a function make_negative that takes number and returns its negative version. If the number is already negative or is 0, leave it unchanged.
Примеры
Ввод
1Вывод
-1Ввод
-5Вывод
-5Ввод
0Вывод
0Нужно реализовать
def make_negative(number: int) -> int:
Теги
math
Přihlaste se, abyste viděli historii odevzdání
Přihlásit sePřihlaste se, abyste mohli použít AI mentora
Přihlásit seVisible tests
1
Input
1Expected
-12
Input
-5Expected
-53
Input
0Expected
04
Input
42Expected
-425
Input
-3Expected
-36
Input
999999Expected
-999999Focus radio
Paused · SomaFM · Fluid