Nickolay Kolev wrote: > I want to make tuples of the elements of a list like this. > > l = [1, 2, 3] > > Wanted tuples: > > (1, 2) > (2, 3) > (3, None) > > I can get the first two tuples using zip(l, l[1:]). How do I get the > last one? >>> l = [1, 2, 3] >>> zip(l, l[1:]+[None]) [(1, 2), (2, 3), (3, None)]