Where is the part of this code that flips the columns and how do I replace it with logic that flips rows instead?
def flipIt(array):
for i in range(len(array)):
length = len(array[i])
for j in range(length // 2):
temp = array[i][j]
array[i][j] = array[i][length - 1 - j]
array[i][length - 1 - j] = temp
#testing
pic = [['@', ' ', ' ', ' ', ' ', '@'],
['@', '@', ' ', ' ', ' ', '@'],
['@', ' ', '@', ' ', ' ', '@'],
['@', ' ', ' ', '@', ' ', '@'],
['@', ' ', ' ', ' ', '@', '@'],
['@', ' ', ' ', ' ', ' ', '@']]
flipIt(pic)
for i in pic:
for j in i:
print(j,end=' ')
print()