Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
not KISS solution in Uncategorized category for Funny Addition by Cjkjvfnby
"""
Every time you write such code in production... God kills a kitten
Please, think of the kittens
"""
from itertools import chain
from operator import mul
from functools import wraps
class AwesomeSumer(type('CheckioSumer', (object,), {'__init__': lambda self, data: setattr(self, 'data', data)})):
"""
This awesome class can store data and do awesome work
"""
def do_awesome(self):
"""
The sum of two integer list via length of "z" string
"""
return len(''.join(chain(*[mul(*item) for item in zip(self.data, ['z'] * 2)])))
def magic_wrapper(funct):
@wraps(funct)
def foo(data):
awesome_instance = funct(data)
return awesome_instance.do_awesome()
return foo
@magic_wrapper
def checkio(data):
""" magic around this """
return AwesomeSumer(data)
Nov. 13, 2013
Comments: