python how to align text writen to a file

Solutions on MaxInterview for python how to align text writen to a file by the best coders in the world

showing results for - "python how to align text writen to a file"
Brook
23 Sep 2019
1file = open(file, "a") 
2table_data = [
3    ['a', 'b', 'c'],
4    ['aaaaaaaaaa', 'b', 'c'], 
5    ['a', 'bbbbbbbbbb', 'c']
6]
7for row in table_data:
8    file.write("{: >20} {: >20} {: >20}".format(*row))