Struggling to open code, that has been saved in Word doc

Hi I have been given Code in a Word Document Template, however I cannot read the code in Word, and when I try and save it as a .py file or .ipynb file to open the file on sypder or Jupyter Notebooks I recieve erros.

Does Anyone know how I can download and read this code, thank you