I'm studying how to make a Python function algorithm again. It's really not easy.
Below is the coding that I redefined the ABS function.
def my_abs(number):
if number < 0:
number * -1
elif number > 0:
number * 1
test1 = 1.7
test2 = -8
a=my_abs(test1)
b=my_abs(test2)
print(a,b)
What's the problem?
Please give me a map~
python
775 Error in x, y, and format string must not be None
1255 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
775 GDB gets version error when attempting to debug with the Presense SDK (IDE)
869 Uncaught (inpromise) Error on Electron: An object could not be cloned
789 M2 Mac fails to install rbenv install 3.1.3 due to errors
© 2025 OneMinuteCode. All rights reserved.