Python Easter Eggs

Uncover the hidden secrets, quirky jokes, and design philosophies buried inside the Python interpreter.

View Repository

The Zen of Python

PEP 20
The guiding philosophy of Python design. Running this imports 19 aphorisms about clean code.
import this
Beautiful is better than ugly.
Explicit is better than implicit...

Antigravity

Web
A tribute to the XKCD comic #353. It opens the browser to a comic about flying with Python.
import antigravity
# Opens browser to xkcd.com/353

Hello World

Module
The shortest, laziest way to run "Hello World" in Python. A classic Easter egg module.
import __hello__
Hello world!

Curly Braces

Syntax
Trying to use C-style curly braces? Python's interpreter has a sassy response for you.
from __future__ import braces
SyntaxError: not a chance

Barry as FLUFL

Joke
An April Fool's joke (PEP 401) that replaces != with the diamond operator <>.
from __future__ import barry_as_FLUFL
print(1 <> 2)
True

Infinite Hash

Math
Python's hash for infinity is the first 6 digits of Pi. A mathematical Easter egg.
hash(float('inf'))
314159