Teaching zip and range in Python 3 I do mathematical biology curriculum development and design and sometimes teach the associated computer labs. The students are very much beginners. Recently, I have had to start working with a Python 3-based system rather than a Python 2.7-based one. Some of the changes in Python 3 have made basic functions much more abstract. I can't have students just type in zip([1,2,3], [4,5,6]) to see what it does. (I had them do list(zip([1,2,3], [4,5,6])), but that's really changing the output of zip into something else.) And range no longer outputs a list -- instead, it outputs something that counts, but again, is quite abstract. How would you explain these things to total beginners?
I don't think the concepts behind generators, sequences and iterators are too difficult to grasp if you're clear on what exactly they are.

The 'old' range(n) function of Python 2 just produces a list of numbers: 

[0, 1, 2, 3, ... , n - 1]


You ask it to give you a list of numbers from $0$ to $n - 1$, and it gives you a list.

The new range(n) doesn't do that. Instead, it makes an object that knows the start, end and step that you asked for... but it doesn't give you a list! This object will, however, give you the next element of the sequence if you ask for it.

Running list(range(n)) specifically asks for the list of all the integers, but in the vast majority of cases, you don't need the list, so there's no point making it and storing the whole thing in memory.

Imagine you wanted to print the numbers 1 to 1000. Python 2's range() would generate every number up front, before you can begin iterating. Clearly, this is very wasteful and pointless; it's much easier to work out each number at the end of the iteration, and doesn't require nearly as much memory. 

However, I suppose that the merits of the feature aren't really relevant or important to absolute beginners; it's better that they gain some understanding of how to use the feature before understanding the merits behind it. Instead, consider explaining like this:


Iterables (such as range and zip) only do work when specifically asked (they're lazy — if your students have had any exposure to functional programming, that might be familiar)
Generally, being lazy makes things faster, because you don't do unnecessary work (e.g. in case you quit the loop early).
If you specifically need the whole list, you can ask for it with list(iterable) — but this is usually not as common as just iterating through with for.


If your students know Python 2's xrange, they'll find range simple to understand.