Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

More Books

Students also viewed these Databases questions