little ex from <dive into python>