← Back to challenges

Return Negative

PythonMediumnumberslogiclanguage_fundamentals

Instructions

Create a function that takes a number as an argument and returns negative of that number. Return negative numbers without any change.

Examples

return_negative(4) ➞ -4

return_negative(15) ➞ -15

return_negative(-4) ➞ -4

return_negative(0) ➞ 0

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Buggy Code (Part 7)