is this blurry Suppose you are given a 6 times 6 matrix fill

is this blurry?

Suppose you are given a 6 times 6 matrix filled with 0s and 1s. All TOWS and all columns have the even number of 1s. Let the user flip one cell (i.e., flip from 1 to 0 or from 0 to 1) and write a program to find which cell was Hipped. Your program should prompt the user to enter a 6 times 6 two-dimensional list with 0s and is and find the first row r and first column c where the even number of is property is violated. The (lipped cell is at (r, c).

Solution

l = []
print \"Enter 6*6 Matrix\"
for i in range(1,7):
print \"Row:\",i,\"\ \"
r = []
for j in range(1,7):
r.append(input())
l.append(r)

r1 = input(\"Enter row to change:\")
c1 = input(\"Enter column to change:\")
v = input(\"Enter value:\")
l[r1][c1] = v
row = 0
column = 0
for i in range(6):
c = 0
for j in range(6):
if(l[i][j]==1):
c += l[i][j]
if(c%2!=0):
row = i
break
for i in range(6):
c = 0
for j in range(6):
if(l[j][i]==1):
c += l[j][i]
if(c%2!=0):
column = i
break
print \"The flipped cell is at:(\",row,\",\",column,\")\"

\"\"\"
sample output

Enter 6*6 Matrix
Row: 1

1
1
1
1
1
1
Row: 2

1
1
1
1
1
1
Row: 3

1
1
1
1
1
1
Row: 4

1
1
1
1
1
1
Row: 5

1
1
1
1
1
1
Row: 6

1
1
1
1
1
1
Enter row to change: 4
Enter column to change: 5
Enter value: 0
The flipped cell is at:( 4 , 5 )
\"\"\"

is this blurry? Suppose you are given a 6 times 6 matrix filled with 0s and 1s. All TOWS and all columns have the even number of 1s. Let the user flip one cell
is this blurry? Suppose you are given a 6 times 6 matrix filled with 0s and 1s. All TOWS and all columns have the even number of 1s. Let the user flip one cell

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site