Problem two in python