Presenting Data neatly... how :)

Cousin Stanley CousinStanley at HotMail.com
Wed Nov 13 18:58:03 EST 2002


|| ...
|| Is there anyway to format it like this:
||
|| Dell            45       40%
|| Microsoft   60       56%
|| IBM             4      5%
|| ...

e-tones ...

Something like this seems to work ...

vList = [ ( 'Dell'  , 45 , 40 ) ,
                ( 'Microsoft' , 60 , 56 ) ,
                ( 'IBM' , 4 , 5 ) ]

for xTup in vList :

    print '    %-12s %3d %3d%% ' % ( xTup[ 0 ] , xTup[ 1 ] , xTup[ 2 ] )

Cousin Stanley







More information about the Python-list mailing list