S
slyraymond
On page 214 of _Learning Python_, the following function is described as one
that will return the smallest item in a group of arguments:
def min1(*args):
res = args[0]
for arg in args[1:]:
if arg < args:
res = arg
return res
However, when the function called with...
print min1(3,4,1,2)
....it returns:
2
Why?
that will return the smallest item in a group of arguments:
def min1(*args):
res = args[0]
for arg in args[1:]:
if arg < args:
res = arg
return res
However, when the function called with...
print min1(3,4,1,2)
....it returns:
2
Why?