[Tutor] format command help

Richard Dillon dillonrw at comcast.net
Tue Oct 7 15:40:24 CEST 2014


I create column headings using \t

     print('base1\tbase2\theight\tarea')

and I would like the numbers to align with the headings. I think that I need to use format instead of doing this:

    print(A,'     ',B,'     ',C,'     ',int(area1))
    print(D,'     ',E,'     ',F,'     ',int(area2))

but I don't know how.
I've looked at code examples and I can't figure out how.

Thanks 




More information about the Tutor mailing list