Ending up


What am I doing wrong in my code?


The syntax error indicates something is wrong immediately before the carat (^). What error might we discover if we work backwards?

Is it your intention to assign new_word a list object? I suspect not, but that's what it looks like to Python. Since the pseudo-list uses the wrong separator (should be a comma) the interpreter raises an error.

This brings us to what the objective is, shallow copy, or slice. That means we need an object (a list) to make the shallow copy from.


Once that is sorted out, I'm dubious as to the validity of white space in the above syntax, but it may well be ignored. If you still get an error, remove the spaces.