• Even the Last

Question related to mission Even the Last

 

I spent entire day for it, help me :(

def digits_multiplication(number): suma = sum(int (i) for i in number[::2]) res = suma * number[-1] return res

print(digits_multiplication(12345))

                            OR

def digits_multiplication(number): res = 0 for i in number[::2]: res += i return res * number[-1]

print(digits_multiplication(12345))