The writing method of three quotation marks is mainly used to avoid string escaping. In python, there are single quotation marks, double quotation marks and three quotation marks. For details, you can check python: single quotation marks, double quotation marks and triple quotation marks. Difference
In what environment did you encounter this problem?
Single quotes are no problem, and I can run it on my own Python 2.7.5.
According to the environment of the questioner, I tried it again and it was ok.
The writing method of three quotation marks is mainly used to avoid string escaping. In python, there are single quotation marks, double quotation marks and three quotation marks. For details, you can check python: single quotation marks, double quotation marks and triple quotation marks. Difference