ex 7

credit to http://learnpythonthehardway.org/