python solutions for problems 15, 16, 20