I hope you assumed that the homework assignment was for a specific programming language that the OP forgot to mention and that programming language probably wasn't Python.
Your answer does at least highlight the fact that even if people here were willing to do the OP's homework, the OP left out at least that important detail of the assignment.
But your answer taken at face value is doing the OP's homework (or in this case doing his web search to cheat on his homework) for him. That generally is a bad idea. It doesn't help the OP learn anything and it encourages more people to try "do my homework for me" posts.