Question: Write a function my_abs (value) that returns the absolute value of value, without using the built-in abs function in Python. You are required to
Write a function my_abs (value) that returns the absolute value of value, without using the built-in abs function in Python. You are required to use an if statement for this question. For example: Test print (my_abs (3.5)) 3.5 print (my_abs(-7)) 7 Result
Step by Step Solution
3.39 Rating (152 Votes )
There are 3 Steps involved in it
Heres an implementation of the myabs function that returns the absolute value of a given value witho... View full answer
Get step-by-step solutions from verified subject matter experts
