I'm looking at this exercise, and don't understand the output.
The Datasets are as follows:
_biggest_number(-10, -5, 5, 10)_ _smallest_number(-10, -5, 5, 10)_ _distance_from_zero(-10)_
And the values returned for each are as follows:
biggest_number = 10 = ok, this is fine
smallest_number = - 10 = again, fine
distance_from_zero = 10 = why is this 10, when it's not an option in the original dataset?
The code is as follows:
_def biggest_number(*args):_ _ print max(args)_ _ return max(args)_ _ _ _def smallest_number(*args):_ _ print min(args)_ _ return min(args)_ _def distance_from_zero(arg):_ _ print abs(arg)_ _ return abs(arg)_
Also, why is there an * in the (*args) for the first two data sets, but then only (arg) for the third - is this because there is more than one value in the first two sets?
Thanks so much, this is really bugging me!