i think this is a very simple question, i just dont code frequently with python.
i am trying to read a line from a file and print it to screen with a number attached before the line .
the code i have and what i think should work is this.
Reader = csv.reader(open('t.csv', 'rb'), delimiter='|') i = -1 for row in Reader: i+=1 print i + row
print i + rowi am trying to concatenate 'i', a number, with a row from file.
the error i get is this
File "line.py", line 34, in __init__ print i + row TypeError: unsupported operand type(s) for +: 'int' and 'list'
i am thinking even if it does not want to concatenate a number and a list, as good as python is on determining types, it should change i to a list type or something like that,