The main question:
I am trying to check every item in this 2d list
board = [['B', 'B', 'B', ' '],['B', 'B', 'B', 'B'],['B', 'B', 'B', 'B']]
if at least one element == ' '
then I want to return my True function differently, if all of them were not ' ', then return False.
this is what I have so far, but it stops at the first iteration of the loops, thinking that the first element inside the line is B, then it will return False before it reaches the 4th element of the first list.
for i in range(len(b)):
for i in range(len(b[1])):
if b[i][i] == ' ':
return True
else:
return False
source
share