I want to take the dimensions of the nested list as desired from the user.
Then append strings given by the user to the corresponding elements.
Find the string of maximum Length in the nested list to properly left justify text.
Then left justify the string to print the strings in the tabular form.
The program should go about this

```
Enter the number of main items in the list: 3
Enter the number of sub items that each list will contain: 4
(1,1):apples
(1,2):oranges
(1,3):cherries
(1,4):banana
(2,1):Alice
(2,2):Bob
(2,3):Carol
(2,4):David
(3,1):dogs
(3,2):cats
(3,3):moose
(3,4):goose
Following list must be created in the program
listOfList= [ ['apples', 'oranges', 'cherries', 'banana'],
              ['Alice', 'Bob', 'Carol', 'David'],
              ['dogs', 'cats', 'moose', 'goose']]
output given by a print table function should be like this:
'''
apples   Alice  dogs
oranges  Bob    cats
cherries Carol  moose
banana   David  goose

```

Here is my actual code

```
#Organising Lists of Lists in tablular Form
x=int(input("Enter the number of main items in the list: "))
y=int(input("Enter the number of sub items that each list will contain: "))
listOfList=[[]]
for i in range(x):
    for j in range(y):
        listOfList[i][j]=input('('+str(i+1)+','+str(j+1)+'):')
def printTable(nestedList):
    maxLen=0
    #this loop finds the max Length of any string in the nestedList
    for i in range(x):
        for j in range(y):
            if len(nestedList[i][j])>maxLen:
                maxLen=len(nestedList[i][j])
    #Loop to display table
    for j in range(y):
        for i in range(x):
            print(nestedList[i][j].ljust(maxLen),sep=' ', end='')
        print()
printTable(listOfList)

```

Error occured:

```
Enter the number of main items in the list: 3
Enter the number of sub items that each list will contain: 4
(1,1):apples
Traceback (most recent call last):
  File "C:\pyscripts\printTable.py", line 7, in <module>
    listOfList[i][j]=input('('+str(i+1)+','+str(j+1)+'):')
IndexError: list assignment index out of range

```