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...
~88 users here now
news about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
If you are about to ask a question, please consider r/learnpython. Homework-style questions will be removed, and you'll be encouraged to post there instead.
Please don't use URL shorteners
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Books and Resources
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
A Python riddle (self.Python)
submitted 1 day ago by la-lalxu
Merry Christmas, /r/python! Here’s a puzzle I came up with to ponder over on your day off:
Write a Python 3 script that imports no modules, contains no parentheses, and prints something to stdout when executed.
stdout
Try to keep the comments spoiler-free; run your answers through base64 or something.
base64
Have fun :)
[–]_avnr 13 points14 points15 points 1 day ago* (1 child)
Here's a solution
[–]deadmilk 6 points7 points8 points 1 day ago (0 children)
... and now I can sleep peacefully. I hate you OP.
[–]spamspamspam 6 points7 points8 points 20 hours ago (1 child)
Just when I was about to quit, I figured it out.
[–]la-lalxu[S] 0 points1 point2 points 17 hours ago (0 children)
Super cool solution!
[–]gaidar 6 points7 points8 points 1 day ago (6 children)
As you don't care what will be printed, then it can be super simple.
Encoded as requested :)
import base64
print(base64.standard_b64decode('QHByaW50CmNsYXNzIGE6cGFzcw==').decode())
[–]genesem 0 points1 point2 points 19 hours ago (0 children)
haha, great! :)
[+]elbiot comment score below threshold-12 points-11 points-10 points 1 day ago (3 children)
Contains no parentesis
[–]cetchmoh 10 points11 points12 points 1 day ago (0 children)
you didnt get it, did you?
[–]gaidar 7 points8 points9 points 1 day ago (1 child)
Run my code to see the answer. Do you see parenthesis in the code anywhere? :)
[–]boarhogpython3 3 points4 points5 points 1 day ago (1 child)
I thought I could do it by doing
sys.stderr = sys.stdout raise nonexistingerror
but that required import sys :(
import sys
[–][deleted] 1 day ago (2 children)
[deleted]
[–]la-lalxu[S] 2 points3 points4 points 1 day ago (1 child)
Parentheses are banned, though!
[–]lambdaqdjango n' shit 0 points1 point2 points 23 hours ago (0 children)
oh, damn!
π Rendered by PID 19397 on app-414 at 2016-12-27 04:42:19.099549+00:00 running d73bd90 country code: US.
[–]_avnr 13 points14 points15 points (1 child)
[–]deadmilk 6 points7 points8 points (0 children)
[–]spamspamspam 6 points7 points8 points (1 child)
[–]la-lalxu[S] 0 points1 point2 points (0 children)
[–]gaidar 6 points7 points8 points (6 children)
[–]genesem 0 points1 point2 points (0 children)
[+]elbiot comment score below threshold-12 points-11 points-10 points (3 children)
[–]cetchmoh 10 points11 points12 points (0 children)
[–]gaidar 7 points8 points9 points (1 child)
[–]boarhogpython3 3 points4 points5 points (1 child)
[–][deleted] (2 children)
[deleted]
[–]la-lalxu[S] 2 points3 points4 points (1 child)
[–]lambdaqdjango n' shit 0 points1 point2 points (0 children)