How to include backslash and quotes in Python strings

前端 未结 4 1117
故里飘歌
故里飘歌 2021-01-27 00:41

I\'ve got an array of special characters that looks something like this.

specialCharList=[\'`\',\'~\',\'!\',\'@\',\'#\',\'$\',\'%\',\'^\',
             \'&\'         


        
4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-27 01:16

    You can use single, double ot triple quotes for delimiting strings.

    So "'", '"' are ways to have a quote character in your string.

提交回复
热议问题