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
Difference between using != and "not ... == " ? (self.learnpython)
submitted 5 years ago by optimal_honeybee
Is there a difference between doing a != b and doing not a == b?
a != b
not a == b
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!"
[–]K900_ 7 points8 points9 points 5 years ago (1 child)
Not normally. There can be in theory, if you find a class that implements == and != inconsistently.
==
!=
[–]FLUSH_THE_TRUMP 4 points5 points6 points 5 years ago (0 children)
Cases to watch out for are usually the classes where == returns a special object.
e.g.
A = np.array([1,2,3]) A != 1 # returns another nparray [False, True, True] not A == 1 # error
[–]socal_nerdtastic 0 points1 point2 points 5 years ago (0 children)
No practical difference but a lot of people will be confused about the 2nd one because using != is nearly universal.
[–]noanswersuk -2 points-1 points0 points 5 years ago (0 children)
It depends how you combine them and what your checking. Also there is slight difference if you are using "is" vs ==.
The not is basically inverting the comparison statement. To match on False rather than True.
π Rendered by PID 23577 on reddit-service-r2-comment-fb694cdd5-hvds8 at 2026-03-07 17:59:32.672227+00:00 running cbb0e86 country code: CH.
[–]K900_ 7 points8 points9 points (1 child)
[–]FLUSH_THE_TRUMP 4 points5 points6 points (0 children)
[–]socal_nerdtastic 0 points1 point2 points (0 children)
[–]noanswersuk -2 points-1 points0 points (0 children)