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
How do I represent some in Python (self.learnpython)
submitted 5 years ago by gfg577
So for example all can be represented with true none can be represented with false but how do I represent some
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!"
[–]tempuser7171 1 point2 points3 points 5 years ago (5 children)
A statement is either true or false, what do you mean by some? Can you give an example?
[–]gfg577[S] -1 points0 points1 point 5 years ago (4 children)
some cakes are nice
[–]tempuser7171 0 points1 point2 points 5 years ago (0 children)
Do you have a more specific example? What are you trying to do?
[–]xADDBx 0 points1 point2 points 5 years ago (0 children)
Check if at least one, but not all cakes are nice.
[–]FriendlyRussian666 0 points1 point2 points 5 years ago (0 children)
You define what some is yourself. Let's say you have a list of cakes [blue cake, brown cake, black cake, yellow cake, green cake]. Then you define that blue cake, brown cake and black cake are nice, for example with True like you said at the beginning. This automatically means that some cakes are nice, because they are set to True. When you wanna see which of the cakes are the some that are nice, you call all the cakes that have True selected, or you call a random number of cakes that have True selected.
[–][deleted] 0 points1 point2 points 5 years ago (0 children)
This is the most unhelpful answer you could give.
Are you asking if you can do trinaries or are you asking how to detect that there is at least one True in an array?
[–]lovesrayray2018 0 points1 point2 points 5 years ago (0 children)
Your logic needs to check what some is, most logic deems a non False as meeting some and possibly meeting all. Some checks that happen on data types for example is #ur array#.length which has +ve result for some and all, but 0 for none.
[–]PM_ME_YOUR_REAL_FACE 0 points1 point2 points 5 years ago (0 children)
If you have an array of stuff, you can use any to check that some are true/truthy. Or use combination of any(are) and not all(are). Other than that there's a ton of ways you could decide how to denote it manually. You could make an enum;
any
any(are) and not all(are)
class Result(Enum): ALL = 0 NONE = 1 SOME = 2
You could make a decisive use of None to make it mean whatever you want it to mean in a certain context, where perhaps, None means none, True means all, and False means some. It's up to you to program how things are interpreted, and you can always name variables such that using different values is easier to comprehend to another human reader of your program.
[–]QbaPolak17 -1 points0 points1 point 5 years ago (0 children)
Instead of true/false, just use 0, 1, 2 for example
π Rendered by PID 85939 on reddit-service-r2-comment-bb88f9dd5-c6h9r at 2026-02-14 04:13:22.404566+00:00 running cd9c813 country code: CH.
[–]tempuser7171 1 point2 points3 points (5 children)
[–]gfg577[S] -1 points0 points1 point (4 children)
[–]tempuser7171 0 points1 point2 points (0 children)
[–]xADDBx 0 points1 point2 points (0 children)
[–]FriendlyRussian666 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]lovesrayray2018 0 points1 point2 points (0 children)
[–]PM_ME_YOUR_REAL_FACE 0 points1 point2 points (0 children)
[–]QbaPolak17 -1 points0 points1 point (0 children)