Light Mode
Dark Mode
even the last - what's wrong with this?

I'm using this:

def checkio(array):

if len(array) > 0: return sum(array[::2])*array[-1] else: return "empty array"

If I put in values and calculate it works, but run and check keeps returning "empty array" and won't accept it.

What am I doing wrong?

Created: Aug. 30, 2016, 6:47 a.m.
Updated: Aug. 30, 2016, 7:58 a.m.
0
1
User avatar
Matt_Wilding