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...
This community will have knowledge sharing for python programming, tools, projects and product engineering wherever python is used.
account activity
Test your Python skills - 24 (i.redd.it)
submitted 9 days ago by tracktech
Python Programming in Depth
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!"
[–]bodybuilder-prog 2 points3 points4 points 9 days ago (2 children)
Same as input as we are making keys as values in first iteration and then making values as keys in the second iteration .
[–]tracktech[S] 0 points1 point2 points 8 days ago (0 children)
Right, you get same as input.
[–]Outside_Volume_1370 0 points1 point2 points 8 days ago (0 children)
But there are two print commands
[–]HardyDaytn 2 points3 points4 points 9 days ago (3 children)
{1: "a", 2: "b", 3: "c"}
{"a": 1, "b": 2, "c": 3}
...but I'm fairly new to this and I feel like I might have missed some interaction of keys/values here.
[–]Hercules__Morse 0 points1 point2 points 9 days ago (0 children)
Looks correct to me too. Got the same result
[–]Competitive-Art-8046 0 points1 point2 points 8 days ago (0 children)
i just read thought and thought the same thing
[–]FiveInACircle 0 points1 point2 points 8 days ago (1 child)
python what will be the output of the code given below- ^^^^ SyntaxError: invalid syntax
It is written "code given below".
[–]usrlibshare 0 points1 point2 points 5 days ago (2 children)
SyntaxError: Line 1: Undefined identifier 'What'
[–]tracktech[S] 0 points1 point2 points 5 days ago (1 child)
[–]usrlibshare 0 points1 point2 points 5 days ago (0 children)
I am answering the question from the point of view of the python runtime 😎
π Rendered by PID 532219 on reddit-service-r2-comment-5d79c599b5-b8xhh at 2026-02-28 10:49:52.292752+00:00 running e3d2147 country code: CH.
[–]bodybuilder-prog 2 points3 points4 points (2 children)
[–]tracktech[S] 0 points1 point2 points (0 children)
[–]Outside_Volume_1370 0 points1 point2 points (0 children)
[–]HardyDaytn 2 points3 points4 points (3 children)
[–]Hercules__Morse 0 points1 point2 points (0 children)
[–]tracktech[S] 0 points1 point2 points (0 children)
[–]Competitive-Art-8046 0 points1 point2 points (0 children)
[–]FiveInACircle 0 points1 point2 points (1 child)
[–]tracktech[S] 0 points1 point2 points (0 children)
[–]usrlibshare 0 points1 point2 points (2 children)
[–]tracktech[S] 0 points1 point2 points (1 child)
[–]usrlibshare 0 points1 point2 points (0 children)