def cube(L): for i in range(len(L)): L[i] = L[i] * L[i] * L[i] return L L = [2, 5] b = cube(L)