Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Even the last solution in Uncategorized category for Even the Last by Antoni_Wojcik
def checkio(array: list[int]) -> int:
if len(array) < 1:
return 0
sum_ = 0
for index, number in enumerate(array):
if index % 2 == 0:
sum_ += number
else:
pass
return sum_ * array[-1]
range(1, len(array), 2)
return None
print("Example:")
print(checkio([0, 1, 2, 3, 4, 5]))
assert checkio([0, 1, 2, 3, 4, 5]) == 30
assert checkio([1, 3, 5]) == 30
assert checkio([6]) == 36
assert checkio([]) == 0
print("The mission is done! Click 'Check Solution' to earn rewards!")
Nov. 22, 2022