Solved problem11 in python3