I have discriminated against those who show no desire to make an effort to think, or read basic "how to ask" pages, or who just don't care. And I will continue to discriminate against those people.
I'm sure if you think about it for a moment you'll agree that the best you can have hoped to accomplish is to discriminate against those who you believe to have the motivations you describe.
Unquestionably, there are people who cut-and-paste a question from their homework without even having made an attempt to solve the problem. MostMost of those questions should receive a (polite) response of "please post your effort so far".
But there are also plenty of people who post a code snippet with a fairly obvious flaw, or who post an incomplete example, not out of laziness but simply because they are so early in the learning process that they do not know and can reasonably be excused for not knowing exactly what is needed to construct a complete, reproducible example of their problem. TheyThey may even have misidentified the problem entirely (egfor example, "Cannot Read From File" when the real problem is "Cannot Iterate a List"). ItIt is really sad to see those questions "attacked" by drive-by down votesdownvotes when what the person actually needs is guidance in understanding where to find the information they need and then how to interpret that information.
It's my opinion that many people (maybe not you, but lots of people on StackOverflowStack Overflow) are unable or uninterested in discerning the difference between the first and second type of person. NoNo one has a responsibility to answer the second person's question (or anyone's question), but it's in the spirit of StackOverflowStack Overflow (in my opinion, anyway) that second person should be allowed to ask their question, and someone who's interested in helping rank beginners to answer it, without receiving negative feedback.
And even in the case of the first person -- who posts no effort at all -- it's ultimately impossible to discern whether they're simply lazy or just so new that they don't even know where to look. SoSo, ideally, rather than making the person feel bad with down votesdownvotes there would be a way to direct them to the correct beginners resource in the form of "read this, then post a specific question if there's something you don't understand". If it continues to happen with multiple questions from the same person then, perhaps, some negative feedback is needed to encourage them to follow the advice they were given or to leave the site.