直接说结果,然后去理解

双引号内不用加反斜杠

单引号内必须加反斜杠

三单引号输入换行需要加单引号

三双引号最为完美,换行转义什么都不用加

#!/usr/bin/python
# -*- coding: utf-8 -*-

str1 = 'python'
str2 = "PYTHON"

print "str1=",str1
print "str12",str2

str3 = 'I\'m a big fan of Pyton.'
print "str3=",str3

str4 = 'We all know that \'A\' and \'B\' are two capital letters.'
print "str4=",str4

str4_ = "We all know that 'A' and 'B' are two capital letters."
print "str4_=",str4_

str5 = 'The teache said:"a b c" is hello'
print "str5=",str5

str6 = "List of name:\
        Hua li\
        Chao Deng"
print "str6=",str6

str7 = """List of name:
Hua li
Chao Deng"""
print "str7=",str7

print 15*"="
str8 = "List of name:\nHua li\nChao Deng"
print "str8=",str8

print 30*"="
str9 = '''List of name:
Hua li #ceshi
Chao Deng@#$%^&*()()_+_
'''
print "str9=",str9

jieguoruxia

str1= python
str12 PYTHON
str3= I'm a big fan of Pyton.
str4= We all know that 'A' and 'B' are two capital letters.
str4_= We all know that 'A' and 'B' are two capital letters.
str5= The teache said:"a b c" is hello
str6= List of name:        Hua li        Chao Deng
str7= List of name:
Hua li
Chao Deng
===============
str8= List of name:
Hua li
Chao Deng
==============================
str9= List of name:
Hua li #ceshi
Chao Deng@#$%^&*()()_+_

参考:python3中单引号,双引号,三个单引号 ,三个双引号的差别,以及反斜杠的用法 python单引号(')、双引号(")、三引号(''',""") Python中单引号,双引号,3个单引号及3个双引号的区别