Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: asaf greenberg <asafgreenberg <at> gmail.com>
Subject: Re: Silly Python riddle
Newsgroups: gmane.comp.python.israel
Date: Saturday 17th December 2011 14:27:24 UTC (over 5 years ago)

  
    
    
  
  
    f=lambda: g();g=set#)

(yuck. why am i participating in this riddle anyway..)


if i there's a class whose constructor returns a callable, it can be shorter.


On 17/12/2011 14:14, Ram Rachum wrote:
Here's a silly Python riddle for you.

Today I opened up a Python 2.7 shell, and ran two commands in it.

>>> f = lambda: g(???)
>>> f() 

(Note that these are the only commands that I ran. You're not allowed to run any other commands before them.)

The riddle: What's the shortest thing you can put instead of ??? so my second command would not raise an exception?


Ram.


_______________________________________________
Python-il mailing list
[email protected]
http://hamakor.org.il/cgi-bin/mailman/listinfo/python-il">http://hamakor.org.il/cgi-bin/mailman/listinfo/python-il


 
CD: 8ms