Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Speedy solution in Speedy category for Even the Last by Cjkjvfnby
#speady same as clear in that case :)
def checkio(array):
return array and sum(array[::2]) * array[-1] or 0
# try it on you computer, checkio does not allow to use timeit module
'''
from timeit import timeit
setup = """
def checkio(array):
return array and sum(array[::2]) * array[-1] or 0"""
stmt = 'checkio([0, 1, 2, 3, 4, 5])'
print(timeit(stmt=stmt, setup=setup))
'''
Feb. 25, 2014
Comments: