No contexto da string Python Raw
Minha versão do Python é:
~$ python --version
Python 2.6.6
Eu tentei seguir em Python (eu quero mostrar tudo):
1:\
usar como sequência de escape
>>> str('Let\'s Python')
"Let's Python"
2:\
usar como sequência de escape
>>> 'Let\'s Python'
"Let's Python"
3:str()
e imprimir como valor e não digitar
>>> print 'Let\'s Python'
Let's Python
4: seu Python é uma string crua
>>> repr('Let\'s Python')
'"Let\'s Python"'
[QUESTÃO]
5: string bruta em Python
>>> print r'Let\'s Python'
Let\'s Python
6: Isso, eu não entendo os seguintes:
>>> r'Let\'s Python'
"Let\\'s Python"
>>> r'\\'
'\\\\'
Por quê\\
? Por que saída em5
e6
são diferentes?r
erepr()
são iguais e não iguais?
Também, por favor, explique sobre a representação interna destring
eraw strings
são iguais ou diferentes.