Write a program to create print array in beautiful format


Topic: Write a program to create print array in beautiful format

Solution

a = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12], [13, 14, 15, 16]]
for i in a:
    row = '|'
    for b in i:
        row = row + ' ' + str(b)
    print(row + ' ' + '|')



List all Python Programs