add Solution for Problem 22, 23 in Python version