various exercises from http://openbookproject.net/thinkcs/python/english2e/index.html