Question: suppose I have the following three models, see as follow: I wanna to construct a Django model query to archive the same effect as the following SQL statement.

**SQL statement**

```
select B.value, C.special
from B inner join C 
where B.version = C.version and B.order = C.order;

```

I got the following three models:

```
class Process(models.Model):
    name = models.CharField(max_length=30)
    description = models.CharField(max_length=150)

class ProcessStep(models.Model):
    process = models.ForeignKey(Process)
    name = models.CharField(max_length=30)
    ...
    order = models.SmallIntegerField(default=1)
    version = models.SmallIntegerField(null=True)

class Approve(models.Model):
    process = models.ForeignKey(Process)
    content = models.CharField(max_length=300)
    ...
    version = models.SmallIntegerField(null=True)
    order = models.SmallIntegerField(default=0)

```

I want to find all Approves that have the same (version, order) tuple matching against the ProcessStep model.

Answer: 
Use [`zip()`](https://docs.python.org/3/library/functions.html#zip) like this:

```
amp = ['a1', 'a2', 'a3', 'a4']
mass = ['m1', 'm2', 'm3', 'm4']
period = ['p1', 'p2', 'p3', 'p4']
ecc = ['e1', 'e2', 'e3', 'e4']
planet = [1, 2, 3, 4]

titles = ['planet', 'amp', 'mass', 'period', 'ecc']

print '{:<6}|{:<6}|{:<6}|{:<6}|{:<6}'.format(*titles)
for item in zip(planet, amp, mass, period, ecc):
    print '{:<6}|{:<6}|{:<6}|{:<6}|{:<6}'.format(*item)

```

Instead of using `planet = [1, 2, 3, 4]`, you can use [`enumerate()`](https://docs.python.org/3/library/functions.html#enumerate) like below:

```
print '{:<6}|{:<6}|{:<6}|{:<6}|{:<6}'.format(*titles)
for i, item in enumerate(zip(amp, mass, period, ecc)):
    print '{:<6}|{:<6}|{:<6}|{:<6}|{:<6}'.format(i+1, *item)

```

**Output:**

```
>>> python print_table.py
planet|amp   |mass  |period|ecc
1     |a1    |m1    |p1    |e1
2     |a2    |m2    |p2    |e2
3     |a3    |m3    |p3    |e3
4     |a4    |m4    |p4    |e4

```
You can use `\t`.

For example:

```
print 'a\t','b\t','\n','c\t','d\t'

```

output:

```
a   b   
c   d   

```