You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Discussion forum for The Joy Of Computing Using Python
Did anyone got question like these question? you have to type answer . Did anyone remember question completly and answer?
def statusboard(M): for i in range(len(M)): for j in range(1,4): if M[i][j-1]!=M[i][j]: index=-1 break if M[j-1][i]!=M[j][i]: index=-1 break if index>0: return i return i b=[['x','o','x','o'], ['x','x','o','x'], ['o','o','x','x'], ['0','o','x','x']] print(statusboard(b))
Ajinkya Kerkar
unread,
Oct 30, 2023, 1:04:24 PM10/30/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Discussion forum for The Joy Of Computing Using Python, Kamala Malar
Yep I got that question too! It was the last question for me. Session III Q 24.
The value I got was 2.
BTW, I believe it was something like these>>>
def statusboard(M):
n = len(M)
for i in range(n):
index = i for j in range(1,n): if M[i][j]!=M[i][j-1]:
index=-1 break if M[j-1][i]!=M[j][i]: index=-1 break if index>0: return i return i
board =[['x','o','x','o'],
['x','x','o','x'], ['o','o','x','x'],
['o','o','x','x']] print(statusboard(board))
& I just can't recall the values in board anymore..