newbie question concerning formatted output

Patrick Down patrick.down at gmail.com
Tue Nov 29 20:58:38 CET 2005


>>> a = [str(i) for i in range(0,17)]
>>> for i in range(0,len(a),3):
...     print " ".join(a[i:i+3])
...
0 1 2
3 4 5
6 7 8
9 10 11
12 13 14
15 16




More information about the Python-list mailing list