Question: I have 'x' list with 'n' number of elements:

```
list=[1,2,3...96,97,98...n]

```

I want to print each 3 elements from the list like this:

```
Name= 1
Last Name= 2
Number= 3

.
.
.

Name= 96
Last Name= 97
Number= 98
.
.
.

Name= n-2
Last Name= n-1
Number= n

```

Is there a way to do that?

Answer: 
User `itertools` to iterate 3 items at a time

```
from itertools import izip
l=range(1,100)
for first,second, last in izip(*[iter(l)]*3):
  print "Name: %d"%first
  print "Last Name: %d" %second
  print "Number: %d" %last
  print "\n"

```
```
labels = ['Name', 'Last Name', 'Number']

list = [1, 2, 3, ...]

label_index = 0
for i in list:
    print '{0}= {1}'.format(labels[label_index], i)

    if labels[label_index] == 'Number':
        label_index = -1

    label_index += 1

```