Hi,
Can someone please explain why if len(word) > col[i][1] is giving me an error saying '>' not supported between instances of 'int' and 'str'
Here is my code and the function takes this list tableData = [['apples', 'oranges', 'cherries', 'banana'],['Alice', 'Bob', 'Carol', 'David'],
['dogs', 'cats', 'moose', 'goose']] as an argument.
Can someone please explain why if len(word) > col[i][1] is giving me an error saying '>' not supported between instances of 'int' and 'str'
Here is my code and the function takes this list tableData = [['apples', 'oranges', 'cherries', 'banana'],['Alice', 'Bob', 'Carol', 'David'],
['dogs', 'cats', 'moose', 'goose']] as an argument.
def myFunction(myData): col = [[0,0],[0,0],[0,0]] for i in range(len(tableData)): for word in tableData[i]: if len(word) > col[i][1]: col[i][1]=word print(col[i][1])