why when its “if not i % 2” should be (2,4,6....8)not (1,5)i dont get it
why is it reading those number instead of not reading and ignore
def checkio (array):
if len (array)== 0:
return 0
result = 0
for i in range (len(array)):
if not i %2:
result += array[i]
return result * array[-1]
print(checkio([1,3,5]))>
Created at: 2020/03/11 19:11; Updated at: 2020/08/17 14:55
The question is resolved.