Harish Vishwanath wrote:
> Hello,
>
> I accidentally did this in the shell.
>
> >>> ''r''
> ''
> >>> ''r'' == ''
> True
> >>> ''r'' == ""
> True
>
> That is . However
> if I try ->
>
> >>> ''c''
> File "", line 1
> ''c''
> ^
> SyntaxError: invalid syntax
> >>> ''z''
> File "", line 1
On Tue, Jan 6, 2009 at 10:28 PM, Harish Vishwanath
wrote:
> Hello,
>
> I accidentally did this in the shell.
>
''r''
> ''
''r'' == ''
> True
''r'' == ""
> True
>
> That is . However if I
> try ->
>
''c''
> File "", line 1
> ''c''
> ^
> SyntaxError: invalid syntax
>>
Hey Harish,
Python automatically concatenates strings constants so this is
actually '' then r'' which is the empty string followed by a 'raw' empty
string. See here,
http://docs.python.org/tutorial/introduction.html#strings. ''u'' and
''b'' will work for the same reason.
- Chris
Harish Vi
Hello,
I accidentally did this in the shell.
>>> ''r''
''
>>> ''r'' == ''
True
>>> ''r'' == ""
True
That is . However if I
try ->
>>> ''c''
File "", line 1
''c''
^
SyntaxError: invalid syntax
>>> ''z''
File "", line 1
''z''
^
SyntaxError: invalid syntax
Any other charac