Python Code for Algorithms(Dasgupta) Problems