printing columns question
Victor Louie
vlouie at telusplanet.net
Sat Mar 24 20:35:43 EST 2001
Hi,
Just looking at some sample code...
for i in trip[dest][1][1:] :
print '\t%-15s%-15s%4d' % (prev, i, citymap[prev][i][0]),
print '%5d:%02d' % (citymap[prev][i][1], citymap[prev][i][2])
prev = i
print "\t-------------------------------------------"
print '\t%-30s%4d' % ("total:", trip[dest][0][0]),
h = trip[dest][0][1] + trip[dest][0][2] / 60
m = trip[dest][0][2] % 60
print '%5d:%02d' % (h, m)
...i was just wondering if anybody could explain to me how the print
worked...
ie. print '\t%-15s%-15s%4d' % (prev, i, citymap[prev][i][0]),
I understand that \t is a tab....but i don't get anything after that
If anyone could help it would be great.
Thanks
Victor
More information about the Python-list
mailing list