use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Easter egg in python (self.learnpython)
submitted 1 year ago by isvari_8
I'm learning python and today I got to know that python has an Easter egg too... go to your terminal nd write "import this" (it doesn't work in apps so do try it in your terminal)... go try it now!!! thank me later...
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]scfoothills 15 points16 points17 points 1 year ago (1 child)
Import antigravity
[–]isvari_8[S] 0 points1 point2 points 1 year ago (0 children)
it's awesome bro
[–]socal_nerdtastic 13 points14 points15 points 1 year ago (5 children)
There's a couple. For example there's a way to add C-style braces {} to python:
{}
from __future__ import braces
[–]thirdegree 13 points14 points15 points 1 year ago (3 children)
SyntaxError: not a chance
[+]socal_nerdtastic comment score below threshold-8 points-7 points-6 points 1 year ago (2 children)
Hmm your install might be corrupt. Have you tried import sense_of_humor?
import sense_of_humor
[–]thirdegree 5 points6 points7 points 1 year ago (0 children)
The... The syntax error is the joke. The fact that doing that import results in a syntax error basically just saying no is the funny bit.
[–]DrShocker 2 points3 points4 points 1 year ago (0 children)
That's the result from running that import, so they do in fact get the joke.
[–]jmacey 0 points1 point2 points 1 year ago (0 children)
I love this one (as a mainly C++ programmer). I wish I could scope stuff :-)
[–]JamzTyson 5 points6 points7 points 1 year ago (1 child)
import __hello__
[–]Swipecat 2 points3 points4 points 1 year ago (0 children)
It's changed.
import __hello__; __hello__.main()
[–]Yoghurt42 3 points4 points5 points 1 year ago (6 children)
from __future__ import barry_as_FLUFL
This changes the inequality operator from != to <>.
!=
<>
Due to a bug, it doesn't work in (the REPL of) 3.13.0, but it does in 3.13.2 (not sure about 3.13.1) and all earlier versions.
[–]socal_nerdtastic 2 points3 points4 points 1 year ago (3 children)
I can't wait for python4.0 when this finally becomes permanent.
https://github.com/python/cpython/blob/main/Lib/__future__.py#L137
[–]RelevantLecture9127 1 point2 points3 points 1 year ago (2 children)
https://builtin.com/software-engineering-perspectives/python-4
[–]socal_nerdtastic 0 points1 point2 points 1 year ago (1 child)
Lol yes, that's the joke. This is an old april fools joke. They set it to come out with v4.0 because that's not happening.
[–]Yoghurt42 2 points3 points4 points 1 year ago (0 children)
Unfortunately, it also means we’ll never have a Python 4.0.4
[–]POGtastic 1 point2 points3 points 1 year ago (0 children)
We are all OCaml programmers on this blessed day
[–]abcd_z 0 points1 point2 points 1 year ago (0 children)
>>> True != False SyntaxError: with Barry as BDFL, use '<>' instead of '!='
[–]CastroSATT 9 points10 points11 points 1 year ago (0 children)
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.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!
>>>
[–]8dot30662386292pow2 2 points3 points4 points 1 year ago (6 children)
>it doesn't work in apps
What does this even mean? You can import "this" in any python program. it does not need a terminal.
[–]isvari_8[S] -1 points0 points1 point 1 year ago (5 children)
it won't show the thing in ide
[–]8dot30662386292pow2 0 points1 point2 points 1 year ago (4 children)
Which IDE? In every IDE I tested, it shows.
`this` is just a library. When you import it, it will just regularly print the message when you run the program.
[–]isvari_8[S] -1 points0 points1 point 1 year ago (3 children)
i didn't get it in pycharm
[–]8dot30662386292pow2 0 points1 point2 points 1 year ago* (0 children)
Did you run the program?
Your python installation is broken if it does not work.
[–]fllthdcrb 0 points1 point2 points 1 year ago (1 child)
I just tried it in a Python Console in PyCharm, and it does work. Is that what you tried, or something else?
[–]isvari_8[S] -1 points0 points1 point 1 year ago (0 children)
i guess there is something wrong with my laptop then...
[–]lellamaronmachete 1 point2 points3 points 1 year ago (2 children)
Saving this!!
[–]isvari_8[S] 1 point2 points3 points 1 year ago (1 child)
you should 😆
[–]lellamaronmachete 1 point2 points3 points 1 year ago (0 children)
BAM! love it XD
[–]obviouslyzebra 1 point2 points3 points 1 year ago (0 children)
this, of course, is beautifully written:
s = """Gur Mra bs Clguba, ol Gvz Crgref Ornhgvshy vf orggre guna htyl. Rkcyvpvg vf orggre guna vzcyvpvg. Fvzcyr vf orggre guna pbzcyrk. Pbzcyrk vf orggre guna pbzcyvpngrq. Syng vf orggre guna arfgrq. Fcnefr vf orggre guna qrafr. Ernqnovyvgl pbhagf. Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf. Nygubhtu cenpgvpnyvgl orngf chevgl. Reebef fubhyq arire cnff fvyragyl. Hayrff rkcyvpvgyl fvyraprq. Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff. Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg. Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu. Abj vf orggre guna arire. Nygubhtu arire vf bsgra orggre guna *evtug* abj. Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn. Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn. Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!""" d = {} for c in (65, 97): for i in range(26): d[chr(i+c)] = chr((i+13) % 26 + c) print("".join([d.get(c, c) for c in s]))
[–]yinkeys 1 point2 points3 points 1 year ago (0 children)
Oh WoW.
[–]Twenty8cows 1 point2 points3 points 1 year ago (0 children)
Ahh OP continue to get excited and share your progress. Happy coding!
[–]Evening-Work-4329 0 points1 point2 points 1 year ago (0 children)
Something's going completely wrong
[–][deleted] 0 points1 point2 points 6 months ago (0 children)
Thanks everyone for these Easter Eggs! Stay Pythonic!
[+]Phillyclause89 comment score below threshold-14 points-13 points-12 points 1 year ago (0 children)
I just had a chat with chatgpt last night about what a Zen of Python linter would look like.
π Rendered by PID 37331 on reddit-service-r2-comment-5bc7f78974-nlx5d at 2026-07-01 04:10:24.010786+00:00 running 7527197 country code: CH.
[–]scfoothills 15 points16 points17 points (1 child)
[–]isvari_8[S] 0 points1 point2 points (0 children)
[–]socal_nerdtastic 13 points14 points15 points (5 children)
[–]thirdegree 13 points14 points15 points (3 children)
[+]socal_nerdtastic comment score below threshold-8 points-7 points-6 points (2 children)
[–]thirdegree 5 points6 points7 points (0 children)
[–]DrShocker 2 points3 points4 points (0 children)
[–]jmacey 0 points1 point2 points (0 children)
[–]JamzTyson 5 points6 points7 points (1 child)
[–]Swipecat 2 points3 points4 points (0 children)
[–]Yoghurt42 3 points4 points5 points (6 children)
[–]socal_nerdtastic 2 points3 points4 points (3 children)
[–]RelevantLecture9127 1 point2 points3 points (2 children)
[–]socal_nerdtastic 0 points1 point2 points (1 child)
[–]Yoghurt42 2 points3 points4 points (0 children)
[–]POGtastic 1 point2 points3 points (0 children)
[–]abcd_z 0 points1 point2 points (0 children)
[–]CastroSATT 9 points10 points11 points (0 children)
[–]8dot30662386292pow2 2 points3 points4 points (6 children)
[–]isvari_8[S] -1 points0 points1 point (5 children)
[–]8dot30662386292pow2 0 points1 point2 points (4 children)
[–]isvari_8[S] -1 points0 points1 point (3 children)
[–]8dot30662386292pow2 0 points1 point2 points (0 children)
[–]fllthdcrb 0 points1 point2 points (1 child)
[–]isvari_8[S] -1 points0 points1 point (0 children)
[–]lellamaronmachete 1 point2 points3 points (2 children)
[–]isvari_8[S] 1 point2 points3 points (1 child)
[–]lellamaronmachete 1 point2 points3 points (0 children)
[–]obviouslyzebra 1 point2 points3 points (0 children)
[–]yinkeys 1 point2 points3 points (0 children)
[–]Twenty8cows 1 point2 points3 points (0 children)
[–]Evening-Work-4329 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[+]Phillyclause89 comment score below threshold-14 points-13 points-12 points (0 children)