Question: Please use python to do it. Thanks SATOR Square Try to create a program which the user could swap both rows and columns as follows:

 Please use python to do it. Thanks SATOR Square Try to

create a program which the user could swap both rows and columnsas follows: C:\WINDOWS\py.exe Welcome to Joseph's SATOR Square C:\WINDOWS\py.exe Welcome to Joseph's

Please use python to do it. Thanks

SATOR Square Try to create a program which the user could swap both rows and columns as follows: C:\WINDOWS\py.exe Welcome to Joseph's SATOR Square C:\WINDOWS\py.exe Welcome to Joseph's SATOR Square 1 2 ['s'. 'A ('A'. 'R' ['T' 'E' ['o', 'P' 'E', 3 4 5 'T', 'o', 'R'] 'P', '0'] 'N' 'E'. '] 'E', 'R', 'A'] 'S'] ' 1 2 3 T's', 'A', 'T', ['A', 'R', 'E', ['t', 'E' 'N' Ir'o', 'P', 'E' ['R', 'O 4 5 'o', 'R'] 'P', 'O'] 'E', 'T'] 'R', 'A'] 'A', 'S'] Which column to swap? 1 Position 1 will swap with 5 which column to swap? 2 Position 2 will swap with 4 ['R', 'o', 'T', 'A', 'S'] ['o', 'R 'A'] ['t'. 'E' 'N 'E', 'T'] 'A', 'P 'E' 'R' '0'] 'A' 'T' 'o', 'R'] ['s', 'o', 'T', ['o', 'P', 'E' T' 'E' 'N' I'A', 'R' 'E ['R', 'A' 'A', 'R'] 'R', 'A'] 'E' 'T'] 'P' '0'l 'O' 'S'] Press Enter to End Program_ Press Enter to End Program_ A template is available for you in Canvas. Requirements Your program should be able to: Read a column number (i.e.: 1, 2, 4 or 5) Swap both the column and row based on the user input Handle exceptions on user input (e.g.: 3 and other) "T"], "A" 1 1st Tenet = [["S", "A", "T", "O", "R"], "A", "R" "E", "P", "0"], I "T", "E" "N", "E" ["0", "P" "E", "R" I "R", "0" "T" "A", "S"]] 1stToSwap [0, 1, 2, 3, 41 print("Welcome to Joseph's SATOR Square ") print(" 1 2 3 4 print(1stTenet[0]) print(Ist Tenet[1]) print(1stTenet[2) print(1stTenet[3]) print(1stTenet [4]) print() 5") try: intColumn = int(input("Which column to swap? ")) -1 intSwapTarget = 4 - intColumn print("Position + str(int Column + 1) + will swap with !! + str(int SwapTarget + 1)) #Row Swap #Generate a List for Column Swap Positions #Remove intColumn from 1st ToSwap #Remove intSwapTarget from 1stToSwap #First Column Swap using 1stToSwap[0] #Second Column Swap using 1stToSwap[1] #Third Column Swap using 1stToSwap[2] | except: print("Error") except: print("Error") print() print(1stTenet[0]) print(1stTenet[1]) print(1stTenet[2]) print(lst Tenet[3]) print(Ist Tenet[4]) input(" Press Enter to End Program") #end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!