I cannot get this code to work. I get an error for line 4 but I don't understand how it could possibly be out of range and why I cannot get this to swap the N to be upside down.
def verticalSwap(n):
for i in range(len(n)):
row1 = n[i]
row2 = n[(len(n))-i]
temp = row2
row2 = row1
row1 = temp
n = ["@ @", "@ @ @", "@ @ @", "@ @ @", "@ @ @", "@ @"]
for i in range(len(n)):
print(n[i])
verticalSwap(n)
print("")
for i in range(len(n)):
print(n[i])
The output is supposed to look like
@ @
@ @ @
@ @ @
@ @ @
@ @ @
@ @