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
PostgreSQLv16

Itt jelenik meg a kód futtatásának eredménye

Visible tests
1
Input
1
Expected-1
2
Input
-5
Expected-5
3
Input
0
Expected0
4
Input
42
Expected-42
5
Input
-3
Expected-3
6
Input
999999
Expected-999999
Focus radio
Paused · SomaFM · Fluid