What a shame I wasn't around 5 hours ago. It seems OP has had the account for a very long time - but used to be a front-end web developer a long time ago, took a long break, and is now getting accustomed to writing code that has to implement more interesting algorithms. I would hope this is someone who is at least somewhat accustomed to rough language in technical forums, and also to researching problems in general. It's a scary world out there and it's good to be prepared.
However, getting a -10 score on a question like this, and ultimately having it closed and deleted, seems like something that should sour anyone's opinion of Stack Overflow.
The close reason is inappropriate and I can only assume that deletion happened to avoid provoking further meta effect. Given the title, the apparent understanding in this comment exchange, and the understanding shown by the answer that was posted, the question could have easily been edited for clarity.
It is, however, a very common duplicate - and a reasonably good signpost for the canonical: Get the cartesian product of a series of lists?. I especially like that the language chosen to describe the problem used the words "all possibilities", and did not use "combinations" (a common misuse of terminology; we dupe-hammer lots of those already).
Other answers covered issues related to civility or "roughness" in comments. I want to focus on some technical aspects of what was said, instead:
What exactly is the technique for the naive approach?
Whole list of that? Simpl[y] run a for loop and make x amount of words.
how to make an empty list and a double for loop (the most crude solution to this)
Of course, it would take four nested loops, so both "a for loop" and "a double for loop" seem like inappropriate descriptions. "nested for loop" is more generic, but obviously this naive approach does not scale.
What exactly should the search terms be?
If you were not able to [search]
I have found that it is appropriate to chastise people for an easily searched question, only when it is easy to do the search without the domain knowledge that comes from knowing the answer already. Even then, some assembly is required here.
Copying and pasting how to make an empty list and a double for loop doesn't get us very far. I get e.g. How can I make multiple empty lists in python? near the top, which is definitely not right.
If we know better terminology for the technique, and give some mention of what we want to do (in OP's own terms), and add the implementation language, we see much more encouraging results. I get Nested loops to find all possible combinations in Python near the top, for example. But this is only a good result for the OP by sheer luck: the question is rambling and hard to understand, and the top answer just happens to propose itertools.product
in a vague way. The accepted answer shows some nested for
loops, but in a way that's attempting to tailor a solution to obscure and very different requirements.
Maybe if we filter for Stack Overflow results, and also use the inaccurate terminology "combinations"? I get the previous question, and then something irrelevant about powersets, and then something that shows the technique in the question and then goes on to ask a strange and hard-to-understand debugging question that is then self-answered. There is, of course, no mention of the appropriate standard library tools. Sending OP away armed to solve the problem the simple way, is taking away a useful learning opportunity.
Modelling the problem more in OP's terms actually seems to do better. I found How can I choose one item from every list, making every possible combination? off the top, which is right on topic. (It's also a clear duplicate of the canonical - just now, I hammered it as such, and cleaned up the title a bit.)
Yes, I understand that we have fairly high expectations for research, socially. But those expectations aren't very well reflected in the site's official requirements.
Why expect the naive approach to be tried anyway?
Part of the explicit purpose of Stack Overflow, as I understand it, is to make it easier for someone in OP's position to find the canonical. Signposts help with that. Pointing them at the canonical is still easier than getting into an argument. It also helps people with vote-to-close privileges do so.
But I also want to dig in further to
You are asking a dumb question and wasting peoples precious time. At least show the most basic attempt of your own.
It is very well established that "showing an attempt" is not part of the requirements to post. It is actually bad for the site to keep trying to insist on such things: it incentivizes new askers - who have perhaps lurked a bit and seen such comments - to nebulously claim that they have "tried searching", or even "tried everything" (which is effectively noise), or decorate their way-too-unfocused "do parts B, C and D of my homework" request with a half-working solution for part A.
Let's look at the homework help policy for a moment:
- Help us understand your baseline.
- Make a good faith attempt to solve the problem yourself first.
- Ask about specific problems with your existing implementation.
Notice that it does not say to show the good faith attempt. More importantly, notice the context of the previous and next items, as well as the elaboration:
Users here respond negatively if your question gives them the impression that you're asking them to do your work for you. On the other hand, questions that ask about a specific issue that you're having a problem with usually receive a much better response.
It should be clear: the reason for expecting that good faith attempt is that it helps the asker to focus and clarify the actual question and look for existing solutions.
Not to "filter out the help vampires". That happens anyway - but that's because help vampires, by definition, do not have a single, focused, clear, non-duplicate question. They have many questions, and typically haven't realized it yet. If they are forced through the process, then eventually they either give up, find all the duplicates, or (admittedly lightning in a bottle) ask a lot of good questions. Or some combination of those.
People with focused, clear questions are not contravening site policy simply because the question is "easy". Many of the best questions are "easy". They just have already been asked a long time ago, exactly because of that.