W kontekście ciągu Python Raw
Moja wersja Pythona to:
~$ python --version
Python 2.6.6
Próbowałem postępować w Pythonie (chcę pokazać wszystko):
1:\
użyj jako sekwencji ucieczki
>>> str('Let\'s Python')
"Let's Python"
2:\
użyj jako sekwencji ucieczki
>>> 'Let\'s Python'
"Let's Python"
3:str()
i wydrukuj jako wartość, a nie typ
>>> print 'Let\'s Python'
Let's Python
4: jego Python surowy ciąg
>>> repr('Let\'s Python')
'"Let\'s Python"'
[PYTANIE]
5: Python raw string
>>> print r'Let\'s Python'
Let\'s Python
6: Nie rozumiem, co następuje:
>>> r'Let\'s Python'
"Let\\'s Python"
>>> r'\\'
'\\\\'
Czemu\\
? Po co wychodzić5
i6
są różne?r
irepr()
są takie same?
Proszę również wyjaśnić o wewnętrznej reprezentacjistring
iraw strings
są takie same lub różne.