Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
without sophisticated stuff solution in Clear category for Min and Max by szperajacyzolw
from types import GeneratorType
from collections.abc import Sequence
def defaultfunc():
pass
def min(arg1, *args, key=defaultfunc()):
argum=[]
if isinstance(arg1, (int, float)):
argum=[arg1]
if len(args)>0:
argum.extend(list(args))
if isinstance(arg1, (Sequence, filter, set)):
if len(args)>0 and isinstance(args, (Sequence, set)):
argum=[list(arg1)]
for each in args:
argum.append(list(each))
else:
argum=list(arg1)
if isinstance(arg1, GeneratorType):
argum=list(iter(arg1))
return sorted(argum, key=key)[0]
def max(arg1, *args, key=defaultfunc()):
argum=[]
if isinstance(arg1, (int, float)):
argum=[arg1]
if len(args)>0:
argum.extend(list(args))
if isinstance(arg1, (Sequence, filter, set)):
if len(args)>0 and isinstance(args, (Sequence, set)):
argum=[list(arg1)]
for each in args:
argum.append(list(each))
else:
argum=list(arg1)
if isinstance(arg1, GeneratorType):
argum=list(iter(arg1))
return sorted(argum, key=key, reverse=True)[0]
July 22, 2016