The problem is likely just what the error message tells you: your back-up copy somehow got "infected" with one or more null bytes (ASCII value 00). Paste your code one block at a time -- say, 50 lines -- to find which contain illegal bytes. Delete the most recently-added code, maybe 5 lines at a time, to find which has the null byte. Retype the offending line, and go on to the next.
Another possibility is to write a simple Python script that reads the file and removes the null bytes use the string replace
method:
with open("homework.py", 'r') as infile:
hw = infile.readlines().replace(chr(0), '')
Now close the file, open it again for 'w', and dump the hw
variable to it.