samedi 9 juillet 2016

TypeError: 'int' object is not callable with Python


I have this slice of Python code:

    print(curr, nxt)
    print (type(curr), type(nxt))
    print (type(curr[0]), type(curr[1]))
    print (type(nxt[0]), type(nxt[1]))

    curr[0] = min(curr[0], nxt[0])
    curr[1] = max(curr[1], nxt[1])
    del condensed[i+1]

But when I run it, I get this output:

[3, 5] [4, 8] 
<class 'list'> <class 'list'> 
<class 'int'> <class 'int'> 
<class 'int'> <class 'int'> 

---> curr[1] = max(curr[1], nxt[1]) 

TypeError: 'int' object is not callable 

I don't understand what I am doing wrong, it seems like all the inputs to max() is fine. Furthermore, it never gets an error with min(). Any ideas?


Aucun commentaire:

Enregistrer un commentaire