How can I raise the numbers in list to a certain power?
Actually your script do what you want, and that is the result (keep in mind that you are applying the power function to [1,2,3,4,5,6,7,8,9])
('Cubic list:', [1, 8, 27, 64, 125, 216, 343, 512, 729])
Your problem is that you also modified the original list, due to the nature on the list type in python. If you want to keep also your original list you should pass a copy of it to your function. You can do it like this
def main():
numbers=[1,2,3,4,5,6,7,8,9]
numbers3=power(numbers[:])
print('Original list:', numbers)
print('Cubic list:', numbers3)