I have two lists where I want to pop elements from one list into the other one. I'm trying to use a [:] slice to make a copy since t don't want to modify the original list.
Why do I get an invalid syntax error?
def make_great(original_list[:], copy = []):
tmp = original_list.pop()
copy.append(tmp)
def show_magicians(ls = []):
for i in ls:
print ("our next magician is "+i+" !")
magician_list = ['daniel', 'david', 'sara', 'jose', 'maria', 'miriam']
show_magicians(magician_list)
Error message:
~/Python/function/ $ python p.py
File "/home/ubuntu/Python/function/p.py", line 2
def make_great(original_list[:], copy):
SyntaxError: invalid syntax