add Solution for problem 8, 9 and 10 in Python version