Discuss / Python / 交作业，为啥不能两个r''''''

### 交作业，为啥不能两个r''''''

Topic source

#### 拜托快给我药这是病得治

#1 Created at ... [Delete] [Delete and Lock User]

print(r'''n=123

f=456.789

s1='Hello,world'

s2='Hello,\'Adam\''

s3= r'Hello,"Bart"'

'''

"s4 = r'''Hello,\nLisa!'''"

)

#### 大源不是太原

#2 Created at ... [Delete] [Delete and Lock User]

print(n,f,s1,s2,s3,s4)

print(r'''
n = 123
f = 456.789
s1 = 'Hello, world'
s2 = 'Hello, \'Adam\''
s3 = r'Hello, "Bart"'
s4 = r'''Hello,
Lisa!'''
''')

print(r'''
n = 123
f = 456.789
s1 = 'Hello, world'
s2 = 'Hello, \'Adam\''
s3 = r'Hello, "Bart"'
s4 = r\'''Hello,
Lisa!\'''
''')

#### 拜托快给我药这是病得治

#3 Created at ... [Delete] [Delete and Lock User]

#### 胡菇凉H

#4 Created at ... [Delete] [Delete and Lock User]

n = 123

f = 456.789

s1 = 'Hello, world'

s2 = 'Hello, \'Adam\''

s3 = r'Hello, "Bart"'

s4 = r'''Hello,

Lisa!'''

print(n,f,s1,s2,s3,s4,sep="\n")

print('------------------------------'*4)

print("n=123\nf=456.789\ns1=Hello,world\ns2=Hello,\'Adam\'\ns3=Hello,\"Bart\"\ns4=Hello,\nLisa!")

123

456.789

Hello, world

Hello, 'Adam'

Hello, "Bart"

Hello,

Lisa!

------------------------------------------------------------------------------------------------------------------------

n=123

f=456.789

s1=Hello,world

s2=Hello,'Adam'

s3=Hello,"Bart"

s4=Hello,

Lisa!

#### 胡菇凉H

#5 Created at ... [Delete] [Delete and Lock User]

print(r'''

n = 123

f = 456.789

s1 = Hello, world

s2 = Hello, 'Adam'

s3 = Hello, "Bart"

s4 = Hello,

Lisa!

''')

#### 我是一个很好吃的火锅

#6 Created at ... [Delete] [Delete and Lock User]

print('''n = 123

f = 456.789

s1 = 'hello world'

s2 = 'hello,\\'adam\\''

s3 = r'hello,"bart"

s4 = \'''hello,

lisa!\''' ''')

• 1