Question: Write a function definition, max_absolute , that takes as arguments 0 or more numbers, and returns the number with the highest absolute value. If no
Write a function definition, max_absolute, that takes as arguments 0 or more numbers, and returns the number with the highest absolute value. If no numbers are specified, the function must return the Python constant None - not the string "None".
You may assume that the arguments passed to the function, if any, are all valid numbers. The function must be able to take an arbitrary number of arguments.
You may test your function as follows:
max_absolute(-100, 2.5, 70) should return -100.
max_absolute(-10) should return -10.
max_absolute() should return the Python constant None (not the string "None")
max_absolute(3, -100, 2, 70, 100, -2, -70) can return either -100 or 100.
Please note that the function must return a result, not print it.
Hint: The built-in Python function abs returns the absolute value of a number.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
