Literals/String: Difference between revisions
Content deleted Content added
m →{{header|Java}}: Stupid wiki formatting... |
examples |
||
Line 44:
Python makes no distinction between single characters and strings. One can use single or double quotes.
'c' # character
'text' == "text"
' " '
" ' "
'\x20' == ' '
u'unicode string'
u'\u05d0' # unicode literal
Verbatim strings are contained within either single or double quotes, but have an r or R prepended to indicate that escape sequences should be interpreted literally. This is often useful with regular expressions.
r'\x20' == '\\x20'
Here-strings are denoted with triple quotes.
''' single triple quote '''
""" double triple quote """
=={{header|PowerShell}}==
|