Skip to content
← Back to Community
Python April Fools Edition
Profile icon
Roar123

In honor of April Fools

I've rewritten many of Python's builtin functions to do wacky things.

Here's the challenge

Fork this repl and ask someone to code Python on it. Wait for them to be completely amazed and confused. And try to assure them of the legitimacy of the config file :)

Program

The program consists of two parts - the demonstration and testing environment where you can write code and see the output.
It uses the builtins library to rename the normal functions and to define the "April Fools" functions. Some of these re-definitions were straight forward but defining print() was pretty challenging so if you're interested, check out the code.

Example

Screenshot 2020-04-01 at 1.29.55 PM

Functions

print() - slowprints in crazy colors input() - asks for input crazy style range() - actually goes up to the given number bool() - returns opposite boolean value map() - maps 'map( )' around every mapped term filter() - filters out True terms and keeps False terms max() - returns minimum min() - returns maximum len() - returns string 'len ' times length abs() - returns negative abs val help() - list of these functions and their definitions

Write some code and see the wacky results! And remember, don't make insensitive jokes about the coronavirus - it's not funny!

Demonstration repl: https://repl.it/@Roar123/Python-April-Fools-Edition
Challenge repl: https://repl.it/@Roar123/just-an-ordinary-python-repl

Voters
Profile icon
CharlieLamb1
Profile icon
Navinor
Profile icon
AndrewZhao1
Profile icon
avibeskrowni
Profile icon
mkhoi
Profile icon
AtriDey
Profile icon
SilentShadowBla
Profile icon
catherinebish
Profile icon
Evanlicious
Profile icon
MarcusWeinberger
Comments
hotnewtop
Profile icon
AtticusKuhn

Haha I tricked my younger brother with this. He was so confused.

Profile icon
Roar123

@AtticusKuhn Good job

Profile icon
BlueComet

Hahaha very funny very confused but I'm sure that's the point

Profile icon
Roar123
Profile icon
CodeLongAndPros

I want this to be put in Python 3.9.

Profile icon
Roar123
Profile icon
CodeLongAndPros

@Roar123 Every year, at 1:01 PM, on april 1st, all python programs have to use python 0.1 syntax.

Profile icon
staticvoidliam7
Profile icon
ThusEndingTheStory
from repr import *

ModuleNotFoundError: No module named 'repr'
repl process died unexpectedly: exit status 1
Error processing line 1 of /opt/virtualenvs/python3/lib/python3.8/site-packages/google_auth-1.35.0-py3.9-nspkg.pth:

Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 175, in addpackage
exec(line)
File "", line 1, in
File "/usr/lib/python3.8/importlib/util.py", line 14, in
from contextlib import contextmanager
File "/usr/lib/python3.8/contextlib.py", line 5, in
from collections import deque
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 597, in
main()
File "/usr/lib/python3.8/site.py", line 580, in main
known_paths = venv(known_paths)
File "/usr/lib/python3.8/site.py", line 512, in venv
addsitepackages(known_paths, [sys.prefix])
File "/usr/lib/python3.8/site.py", line 367, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python3.8/site.py", line 214, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python3.8/site.py", line 185, in addpackage
import traceback
File "/usr/lib/python3.8/traceback.py", line 3, in
import collections
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'
repl process died unexpectedly: exit status 1
Error processing line 1 of /opt/virtualenvs/python3/lib/python3.8/site-packages/google_auth-1.35.0-py3.9-nspkg.pth:

Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 175, in addpackage
exec(line)
File "", line 1, in
File "/usr/lib/python3.8/importlib/util.py", line 14, in
from contextlib import contextmanager
File "/usr/lib/python3.8/contextlib.py", line 5, in
from collections import deque
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 597, in
main()
File "/usr/lib/python3.8/site.py", line 580, in main
known_paths = venv(known_paths)
File "/usr/lib/python3.8/site.py", line 512, in venv
addsitepackages(known_paths, [sys.prefix])
File "/usr/lib/python3.8/site.py", line 367, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python3.8/site.py", line 214, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python3.8/site.py", line 185, in addpackage
import traceback
File "/usr/lib/python3.8/traceback.py", line 3, in
import collections
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'
repl process died unexpectedly: exit status 1
Error processing line 1 of /opt/virtualenvs/python3/lib/python3.8/site-packages/google_auth-1.35.0-py3.9-nspkg.pth:

Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 175, in addpackage
exec(line)
File "", line 1, in
File "/usr/lib/python3.8/importlib/util.py", line 14, in
from contextlib import contextmanager
File "/usr/lib/python3.8/contextlib.py", line 5, in
from collections import deque
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 597, in
main()
File "/usr/lib/python3.8/site.py", line 580, in main
known_paths = venv(known_paths)
File "/usr/lib/python3.8/site.py", line 512, in venv
addsitepackages(known_paths, [sys.prefix])
File "/usr/lib/python3.8/site.py", line 367, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python3.8/site.py", line 214, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python3.8/site.py", line 185, in addpackage
import traceback
File "/usr/lib/python3.8/traceback.py", line 3, in
import collections
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'
repl process died unexpectedly: exit status 1
Error processing line 1 of /opt/virtualenvs/python3/lib/python3.8/site-packages/google_auth-1.35.0-py3.9-nspkg.pth:

Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 175, in addpackage
exec(line)
File "", line 1, in
File "/usr/lib/python3.8/importlib/util.py", line 14, in
from contextlib import contextmanager
File "/usr/lib/python3.8/contextlib.py", line 5, in
from collections import deque
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 597, in
main()
File "/usr/lib/python3.8/site.py", line 580, in main
known_paths = venv(known_paths)
File "/usr/lib/python3.8/site.py", line 512, in venv
addsitepackages(known_paths, [sys.prefix])
File "/usr/lib/python3.8/site.py", line 367, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python3.8/site.py", line 214, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python3.8/site.py", line 185, in addpackage
import traceback
File "/usr/lib/python3.8/traceback.py", line 3, in
import collections
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'
repl process died unexpectedly: exit status 1
Error processing line 1 of /opt/virtualenvs/python3/lib/python3.8/site-packages/google_auth-1.35.0-py3.9-nspkg.pth:

Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 175, in addpackage
exec(line)
File "", line 1, in
File "/usr/lib/python3.8/importlib/util.py", line 14, in
from contextlib import contextmanager
File "/usr/lib/python3.8/contextlib.py", line 5, in
from collections import deque
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 597, in
main()
File "/usr/lib/python3.8/site.py", line 580, in main
known_paths = venv(known_paths)
File "/usr/lib/python3.8/site.py", line 512, in venv
addsitepackages(known_paths, [sys.prefix])
File "/usr/lib/python3.8/site.py", line 367, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python3.8/site.py", line 214, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python3.8/site.py", line 185, in addpackage
import traceback
File "/usr/lib/python3.8/traceback.py", line 3, in
import collections
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'
repl process died unexpectedly: exit status 1
Error processing line 1 of /opt/virtualenvs/python3/lib/python3.8/site-packages/google_auth-1.35.0-py3.9-nspkg.pth:

Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 175, in addpackage
exec(line)
File "", line 1, in
File "/usr/lib/python3.8/importlib/util.py", line 14, in
from contextlib import contextmanager
File "/usr/lib/python3.8/contextlib.py", line 5, in
from collections import deque
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 597, in
main()
File "/usr/lib/python3.8/site.py", line 580, in main
known_paths = venv(known_paths)
File "/usr/lib/python3.8/site.py", line 512, in venv
addsitepackages(known_paths, [sys.prefix])
File "/usr/lib/python3.8/site.py", line 367, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python3.8/site.py", line 214, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python3.8/site.py", line 185, in addpackage
import traceback
File "/usr/lib/python3.8/traceback.py", line 3, in
import collections
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'
repl process died unexpectedly: exit status 1
Error processing line 1 of /opt/virtualenvs/python3/lib/python3.8/site-packages/google_auth-1.35.0-py3.9-nspkg.pth:

Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 175, in addpackage
exec(line)
File "", line 1, in
File "/usr/lib/python3.8/importlib/util.py", line 14, in
from contextlib import contextmanager
File "/usr/lib/python3.8/contextlib.py", line 5, in
from collections import deque
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 597, in
main()
File "/usr/lib/python3.8/site.py", line 580, in main
known_paths = venv(known_paths)
File "/usr/lib/python3.8/site.py", line 512, in venv
addsitepackages(known_paths, [sys.prefix])
File "/usr/lib/python3.8/site.py", line 367, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python3.8/site.py", line 214, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python3.8/site.py", line 185, in addpackage
import traceback
File "/usr/lib/python3.8/traceback.py", line 3, in
import collections
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'
repl process died unexpectedly: exit status 1
Error processing line 1 of /opt/virtualenvs/python3/lib/python3.8/site-packages/google_auth-1.35.0-py3.9-nspkg.pth:

Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 175, in addpackage
exec(line)
File "", line 1, in
File "/usr/lib/python3.8/importlib/util.py", line 14, in
from contextlib import contextmanager
File "/usr/lib/python3.8/contextlib.py", line 5, in
from collections import deque
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 597, in
main()
File "/usr/lib/python3.8/site.py", line 580, in main
known_paths = venv(known_paths)
File "/usr/lib/python3.8/site.py", line 512, in venv
addsitepackages(known_paths, [sys.prefix])
File "/usr/lib/python3.8/site.py", line 367, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python3.8/site.py", line 214, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python3.8/site.py", line 185, in addpackage
import traceback
File "/usr/lib/python3.8/traceback.py", line 3, in
import collections
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'
repl process died unexpectedly: exit status 1
Error processing line 1 of /opt/virtualenvs/python3/lib/python3.8/site-packages/google_auth-1.35.0-py3.9-nspkg.pth:

Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 175, in addpackage
exec(line)
File "", line 1, in
File "/usr/lib/python3.8/importlib/util.py", line 14, in
from contextlib import contextmanager
File "/usr/lib/python3.8/contextlib.py", line 5, in
from collections import deque
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 597, in
main()
File "/usr/lib/python3.8/site.py", line 580, in main
known_paths = venv(known_paths)
File "/usr/lib/python3.8/site.py", line 512, in venv
addsitepackages(known_paths, [sys.prefix])
File "/usr/lib/python3.8/site.py", line 367, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python3.8/site.py", line 214, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python3.8/site.py", line 185, in addpackage
import traceback
File "/usr/lib/python3.8/traceback.py", line 3, in
import collections
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'
repl process died unexpectedly: exit status 1
Error processing line 1 of /opt/virtualenvs/python3/lib/python3.8/site-packages/google_auth-1.35.0-py3.9-nspkg.pth:

Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 175, in addpackage
exec(line)
File "", line 1, in
File "/usr/lib/python3.8/importlib/util.py", line 14, in
from contextlib import contextmanager
File "/usr/lib/python3.8/contextlib.py", line 5, in
from collections import deque
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 597, in
main()
File "/usr/lib/python3.8/site.py", line 580, in main
known_paths = venv(known_paths)
File "/usr/lib/python3.8/site.py", line 512, in venv
addsitepackages(known_paths, [sys.prefix])
File "/usr/lib/python3.8/site.py", line 367, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python3.8/site.py", line 214, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python3.8/site.py", line 185, in addpackage
import traceback
File "/usr/lib/python3.8/traceback.py", line 3, in
import collections
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'
repl process died unexpectedly: exit status 1
Error processing line 1 of /opt/virtualenvs/python3/lib/python3.8/site-packages/google_auth-1.35.0-py3.9-nspkg.pth:

Fatal Python error: init_import_size: Failed to import the site module
Python runtime state: initialized
Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 175, in addpackage
exec(line)
File "", line 1, in
File "/usr/lib/python3.8/importlib/util.py", line 14, in
from contextlib import contextmanager
File "/usr/lib/python3.8/contextlib.py", line 5, in
from collections import deque
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3.8/site.py", line 597, in
main()
File "/usr/lib/python3.8/site.py", line 580, in main
known_paths = venv(known_paths)
File "/usr/lib/python3.8/site.py", line 512, in venv
addsitepackages(known_paths, [sys.prefix])
File "/usr/lib/python3.8/site.py", line 367, in addsitepackages
addsitedir(sitedir, known_paths)
File "/usr/lib/python3.8/site.py", line 214, in addsitedir
addpackage(sitedir, name, known_paths)
File "/usr/lib/python3.8/site.py", line 185, in addpackage
import traceback
File "/usr/lib/python3.8/traceback.py", line 3, in
import collections
File "/usr/lib/python3.8/collections/init.py", line 27, in
from reprlib import recursive_repr as _recursive_repr
File "/opt/virtualenvs/python3/lib/python3.8/site-packages/reprlib.py", line 3, in
from repr import *
ModuleNotFoundError: No module named 'repr'
repl process died unexpectedly: exit status 1

Profile icon
ThusEndingTheStory

@ThusEndingTheStory longest error ever

Profile icon
Wilke000

Great job!

Profile icon
Evanlicious

Python 3.9 in a nutshell. Nice job!

Profile icon
Roar123
Profile icon
Viper2211

Dang. Thats cool!

Profile icon
Roar123

@Viper2211 Thanks!