TypeError: 'int' object is not iterable

前端 未结 4 434
[愿得一人]
[愿得一人] 2021-01-29 16:21

I am trying to have a program look inside multiple lists to see if there are multiple integers in those lists. I received an answer on a previous question I asked to accomplish

4条回答
  •  长情又很酷
    2021-01-29 16:49

    The first parameter to all_num_in_any_list, [2,3,4,5,6,7,8,9], is a single list, not a list of lists. When you iterate through it, d is 1, then d is 2, and so forth. When you pass d as the first parameter to all_num_in_list, it is trying to treat it as a list even though it is an integer.

提交回复
热议问题