Python assignment three for CS 223p 02