A python string is worth saying.
Look first:
>>>"Hello world!"‘Hello world!‘
We write a double-quote, but after printing it is a single quote.
What's the difference?
The answer is that there is no difference between the single and double cited .
>>>‘Let‘s go!‘
The above code is wrong, assuming that the string itself includes a single argument, then use the double-cited
Identical, assuming that the string itself has a double argument. Then you need to use a single citation .
Then the question comes again. What if a string includes both a single and double-cited arguments?
Need to be escaped :
\"I\‘m OK\".‘
Stitching strings:
>>>"Let‘s Say" ‘"Hello, world!"‘‘Let\‘s Say "Hello, world!"‘
Write two strings in a row. Python will be stitched together!
Long String
Enclosed in three-lead, it is possible to cross the line:
print‘‘‘This is avery verylong long string!‘‘‘
Raw String
Forbidden Escape, original string has R start !
printr‘\(~_~)/ \(~_~)/‘
Unicode string
Use the U prefix to represent a Unicode string
printu‘汉字‘
Python Basics-high-speed transformation: strings