Answer to Question #110041 in Python for Audrey

Question #110041
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()
1
Expert's answer
2020-04-16T03:19:41-0400
Dear Audrey, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS