+ 1
Why this comand is not working?
numbers = list(range(5, 20, 2)) Traceback (most recent call last): File "<pyshell#114>", line 1, in <module> numbers = list(range(5, 20, 2)) TypeError: 'int' object is not callable
2 odpowiedzi
+ 4
I tried it and it worked without any problems. If the error message says that something is "not callable" that might be a hint that parentheses were used incorrectly:
a = 5 # a is an integer
a() # trying to call an int object like a function
=> TypeError: 'int' object is not callable
+ 3
I agree with Anna, I don't see any issue with that line. Could it be that you used list or range as a variable earlier? Something like this can cause it:
range = 200
numbers = list(range(5, 20, 2))