?

Log in

No account? Create an account
Puzzle - Arvind Narayanan's journal [entries|archive|friends|userinfo]

Puzzle [Jan. 6th, 2009|11:16 pm]
Arvind Narayanan
[Tags|, ]

$ python
>>> ''r''==""
True
>>>
Points only if you figure it out without trying it in a shell :-)

Comments screened. Edit. Now unscreened.
LinkReply

Comments:
[User Picture]From: patrickwonders
2009-01-07 05:30 am (UTC)
Font troubles.
(Reply) (Thread)
[User Picture]From: arvindn
2009-01-07 05:32 am (UTC)
:-)
(Reply) (Parent) (Thread)
From: antrix.net
2009-01-07 07:00 am (UTC)
don't get it :-?
(Reply) (Thread)
[User Picture]From: ethernight
2009-01-07 07:14 am (UTC)
Operator overloading?
(Reply) (Thread)
From: statictype.org
2009-01-07 11:08 am (UTC)

Luke, use a text editor

In a less misleading syntax:
""r""==""
Reminds of this question: Why doesn't this bit of code compile:
float ReadFileAndCalculateAverage(FILE *InputFile, int Values[], int LengthOfValues, int *NumberOfValuesRead)
{
   float average;
   int i;
   // Read the Values array from InputFile.

   // Code eliminated for brevity>

   // Now calculate the average.
   for (i = 1 ; i <= *NumberOfValuesRead ; i += 1)
   {
      average += Values[i];
   }
   average = average/*NumberOfValuesRead;
   return average;
}
(Reply) (Thread)
From: ext_125565
2009-01-07 03:19 pm (UTC)

single vs. double

The quotes around the r are single quotes, so it is read as emptystring r emptystring == emptyrstring. I'm surprised this compiles.

There has to be something else...awaiting the answer.
(Reply) (Thread)
From: fixious
2009-01-07 09:57 pm (UTC)

easy

Raw string operator and implicit concatenation.
(Reply) (Thread)
[User Picture]From: mssnlayam
2009-01-07 11:11 pm (UTC)
I increased the font size a lot and figured you had single quotes.
(Reply) (Thread)