Question
Write a menu function that will allow the TA to run any of the above functions. Your menu should continue to ask the user what
Write a menu function that will allow the TA to run any of the above functions. Your menu should continue to ask the user what they wish to do if the user types in "Y" to continue and stop if they type in "N" to stop. Your menu function must use a loop. It is not acceptable to call your menu function more than once in your program. You can call this function "main()". For example --- Your program may look like this:
1. Print every other character of a string
2. Find elements common to 2 lists.
3. Modify tic-tac-toe board.
Which would you like to do? (Enter the corresponding number)
#The program runs & shows the output Would you like to continue? (enter "Y" to continue, "N" to stop)
1. Print every other character of a string
2. Find elements common to 2 lists.
3. Modify tic-tac-toe board.
Which would you like to do? (Enter the corresponding number)
def change(board): board = [['X', 'O', 'X'], ['O', 'X', ''], ['', 'O', 'X']] for i in range(len(board)): for j in range(len(board[i])): if board[i][j] == 'X': board[i][j] = 'O' elif board[i][j] == 'O': board[i][j] = 'X' print(board)
change(board)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started