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

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!