class Solution:
def flipAndInvertImage(self, A):
"""
:type A: List[List[int]]
:rtype: List[List[int]]
"""
def invert(value):
if value==1:
return 0
else:
return 1
for ListIn in A:
ListCopy = ListIn[:] # cannot use ListCopy = List, otherwise error will appear
print (ListCopy)
for i in range(len(A[0])):
ListIn[i] = invert(ListCopy[len(A[0])-i-1])
return A