I'm studying how to rebuild the Python function algorithm. 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
© 2025 OneMinuteCode. All rights reserved.