my2 = list(map(int, my3)) TypeError: 'list' object is not callable
时间: 2024-04-23 21:06:27 浏览: 67
map转化为list
5星 · 资源好评率100%
This error occurs when you try to call a list as if it were a function. It usually happens when you accidentally use parentheses instead of square brackets to access an element of a list.
For example, if you have a list called "my_list" and you want to access the first element, you should use square brackets like this:
```
first_element = my_list[0]
```
If you accidentally use parentheses instead of square brackets, like this:
```
first_element = my_list(0)
```
You will get the "list object is not callable" error.
In your specific code, it's hard to tell exactly what's causing the error without seeing more context. However, it looks like you might be trying to call a list as if it were a function on this line:
```
my2 = list(map(int, my3))
```
Make sure that "my3" is actually a list and that you're using square brackets to access its elements.
阅读全文