Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
7 options solution in Creative category for Funny Addition by Merzix
from random import choice, shuffle
exec('from {} import mean'.format(choice(('statistics', 'scipy', 'numpy'))))
def checkio(data):
return choice([
lambda x: shuffle(x) or checkio(x),
lambda x: checkio([int(i) for i in str(x)[1:-1].split(', ') if i]),
lambda x: max(x) + min(x),
lambda x: mean(x) * len(x),
lambda x: x[0].__add__(x[-1]),
lambda x: x[0] + x[~0],
sum,
])(data)
if __name__ == '__main__':
assert checkio([5, 5]) == 10, 'First'
assert checkio([7, 1]) == 8, 'Second'
Sept. 5, 2018