Skip to content

this Module

The this module displays the Zen of Python, a philosophy guide for Python programming by Tim Peters.

Complexity Reference

Operation Time Space Notes
Import module O(n) O(n) n = Zen text length (decode + print)

The Zen of Python

Viewing the Zen

import this  # Prints on import

# Prints:
# The Zen of Python, by Tim Peters
#
# Beautiful is better than ugly.
# Explicit is better than implicit.
# Simple is better than complex.
# Complex is better than complicated.
# Readability counts.
# ...

The Zen offers guidance for Pythonic code:

  • Use simple, clear approaches
  • Readability matters
  • Practicality beats purity
  • Errors should never pass silently
  • Flat is better than nested
  • Sparse is better than dense