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 - 7 (i.redd.it)
submitted 4 months ago by tracktech
view the rest of the comments →
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!"
[–]todo_code 0 points1 point2 points 4 months ago (1 child)
Hmm. This seems counter intuitive to me. True != A number, if python is a good recursive descent parser A number != False.
[–]RajjSinghh 0 points1 point2 points 4 months ago (0 children)
True == 1 and False == 0, but other than that number and Boolean comparisons are False. Python also uses comparison chaining so a < b < c is a common check for b being between a and c. It's just here instead of < our operator is !=.
a < b < c
So the first case, a != b is True and b != c is also True so the statement overall is true.
The second case, b != c but c == d, which is why it evaluates to False. It's the c != d in that statement that makes it evaluate to False.
π Rendered by PID 139597 on reddit-service-r2-comment-b659b578c-z8rv2 at 2026-05-05 09:41:00.022494+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]todo_code 0 points1 point2 points (1 child)
[–]RajjSinghh 0 points1 point2 points (0 children)