AI / Google Antigravity Gemini Fundamentals Interview Questions
What is the Python `import antigravity` Easter egg and what does it demonstrate?
The import antigravity Easter egg is a hidden joke built into Python's standard library since Python 3. When executed, it opens a web browser pointing to the XKCD webcomic strip #353, which humorously depicts Python enabling flight by simply installing a library.
# Python Easter egg import antigravity # -> Opens https://xkcd.com/353/ in your default web browser # The antigravity module also contains a hidden geocode function: import antigravity print(dir(antigravity)) # Output: ['__builtins__', '__doc__', '__file__', '__loader__', # '__name__', '__package__', '__spec__', 'fly', 'geohash'] # The geohash function implements the xkcd geohashing algorithm: antigravity.geohash(37.421542, -122.085589, b"2005-05-26-10458.68") # Computes a Geohash based on date and Dow Jones opening price # The module's source code is a fun read: import inspect import antigravity print(inspect.getsource(antigravity))
| Easter egg | How to trigger | What it does |
|---|---|---|
| import antigravity | import antigravity | Opens XKCD #353 in browser; exposes geohash() |
| import this | import this | Prints the Zen of Python (PEP 20) |
| import __hello__ | import __hello__ | Prints 'Hello World!' |
| Barry's time machine | from __future__ import braces | Raises SyntaxError: not a chance |
Why interviewers ask about it: knowledge of import antigravity signals familiarity with Python's culture, the standard library's hidden features, and comfort with exploring the language beyond its functional use. The XKCD comic it references captures Python's philosophy of making powerful things easy to do.
More Related questions...