the code contains the questions starting with # and the solutions below it. entire code is written in python