Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
MinMax solution in Clear category for Min and Max by Seaclaid
def min(*args, **kwargs):
key = kwargs.get("key",None)
num=0
if len(args)==1:
args=list(args[0])
temp=args[0]
for i in range(len(args)):
if key!=None:
if key(temp)>key(args[i]):
temp=args[i]
else:
if temp>args[i]:
temp=args[i]
print(temp)
return temp
def max(*args, **kwargs):
key = kwargs.get("key",None)
num=0
if len(args)==1:
args=list(args[0])
temp=args[0]
for i in range(len(args)):
if key!=None:
if key(temp)
Jan. 7, 2017