I wrote a piece of code in python that reads a string, split it into 2 parts,the first being a string again and the second being an integer. For example
ABDKEK 1255443
The code is as follows:
L=raw_input()
ls=L.split()
num=int(ls[1])
L=ls[0]
len=len(L)
and it gives the following error
len=len(L)
TypeError: 'int' object is not callable
I make the following change in the code:
length=len(L)
and it works.
Can anyone explain what does the error 'int' object is not callable mean??
lenas a variable name. If you do, you'll no longer be able to access the builtin function namedlen. Note that you'll get the same error from, e.g.,3(2). An int cannot be called.