Issue
I have a strange problem in python (using Spyder with python 3.7). I was writing a couple of for loops like so:
y=2.55
for x in range(0, 250):
z = x/y/1000.
Very simple stuff however this code randomly decides to throw for the line where the for loop starts:
TypeError: 'tuple' object is not callable.
I really don't understand where this is going wrong as it seems like such a simple piece of code...
Solution
It means that you have a tuple named range
in your code. Try renaming that tuple into something else, like my_range
, so to not overwrite the built-in range
method in your python.
Answered By - Red
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.