hw solutions in python