N
Nickolay Kolev
Hi all,
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?
Many thanks in advance,
Nicky
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?
Many thanks in advance,
Nicky