I've seen some questions before by people just getting into programming or a language that get downvoted/closed with the reason being that they're 'homework' questions and that they should have tried first themselves.
But, if they don't have any experience they might just not know how to do something, so they couldn't try it themselves first.