note that this is setting out_lines to the same list as words -- so if you pop() from it, both will change. What that the intent, or did you want a copy?