My laptop restarted and when it switched back on, I was unable to run any of the code that had been working previously. As you can see it says there is an error in line 1, saying there is an invalid character, but this had been working before so I am unsure what is wrong and know that it should start in this way. If anyone could help me it would be greatly appreciated.
That seems a lot like an encoding problem to me, a thing that works well in this cases is to erase the line and retype it (not copy/paste). If you get an error on line 2, this means that your encoding is corrupted.
The thing to do then is to edit your file in an editor that allows to display "invisible characters" which are those that causes the problem.
It's a windows related problem, working with utf8 instead of microsoft's one should prevent it from reappearing.