def print_items(seq): for item in seq: print item, print print_items(range(10)) print_items('python') print_items({'foo': 1, 'bar': 2, 'baz': 3})