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
The statement for n in numbers in this code is causing the problem
def all_num_in_list(d, numbers):
for n in numbers:
if n not in d:
return False
return True
The Partial Traceback is
if n not in d
def all_num_in_list(d, numbers):
def all_num_in_any_list(lists, numbers):
if all_num_in_any_list([2, 3, 4, 5, 6, 7, 8, 9], [row, box1, all(row[row.index(0)])]):
TypeError: 'int' object is not iterable
So in function all_num_in_any_list you are already iterating for d in lists over the list lists to get integers which is passed to all_num_in_list. But here while trying to compare n with an atom d, is where the Error Happened.
Think Over?
Did you intend to do an integer comparition like n != d instead of if n not in d
.
Note::: Next Time please post the Complete Traceback