Why this comand is not working? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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

15th Dec 2018, 2:34 PM
Kyo Kai
Kyo Kai - avatar
2 Answers
+ 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
15th Dec 2018, 2:54 PM
Anna
Anna - avatar
+ 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))
15th Dec 2018, 3:08 PM
Kishalaya Saha
Kishalaya Saha - avatar