Depends
If you just come here and post "hi please help I am new to Python have to make program print 1 to 100 please give me code" then no. If you post an actual on-topic challenge-formatted question that adds something to the site, it doesn't really matter whether or not it was homework (unless your exact homework was to golf your code. I hope not).
Really, the two things we need to consider: is it on-topic, and do you deserve credit for it?
Is it on-topic?
That depends on whether or not you made it on-topic. Whether or not it's on-topic has nothing to do with whether or not it's inspired by your homework or not, but just based on how you made it.
Do you deserve credit for it?
Probably. Since your homework relies on certain algorithms that you can then adapt into code-golf challenges, it's really no different from creating a challenge from an already known sequence or a known algorithm. The point is that you still had to put forth the effort to extract the algorithms from the problem and adapt it into a PPCG-on-topic challenge.
Overall, as long as you didn't just copy-paste and it's on-topic, I don't see a problem with it.