Having both single and double quotation in a python string

后端 未结 6 609
悲&欢浪女
悲&欢浪女 2020-11-29 09:19

Hi I\'m trying to have a string that contains both single and double quotation in python -- (\'\"). The reason I need this expression is to use as an input to some external

6条回答
  •  粉色の甜心
    2020-11-29 09:40

    Use triple-quoted strings:

    """ This 'string' contains "both" types of quote """
    ''' So ' does " this '''
    

提交回复
热议问题