Python Programming Language Easter Egg - Python Xkcd Comic

Open Python Interactive Interpreter, and type:

import antigravity

It will open your default browser, and open a classic XKCD comic, telling about the remarkable simplicity of Python.

User Rating:
7.0
  7.0/10 with 1 votes
Contributed By: Anonymous on 12-30-2009
Reviewed By: MonicaIngram
Special Requirements: Python 3.x
Please correct this Egg if you see errors.

Pictures and Videos

None posted yet. Send us yours and be the first!

Comments

Cleo writes:
Just a note that in 3.1 there is also an extra function in the antigravity library, called geohash (from http://xkcd.com/426/ ). For the curious: def geohash(latitude, longitude, datedow): '''Compute geohash() using the Munroe algorithm. >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68') 37.857713 -122.544543 ''' # http://xkcd.com/426/ h = hashlib.md5(datedow).hexdigest() p, q = [('%f' % float.fromhex('0.' + x)) for x in (h[:16], h[16:32])] print('%d%s %d%s' % (latitude, p[1:], longitude, q[1:]))
22 of 40 people found this comment helpful. Did you? Yes No


Register - Privacy Policy - About Us - Contact Us