<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Lesson 17
Step1:  A list of Dictionaries isa Data Structure.
Step2:  The Tic-Tac-Toe Game Program
We can use data structures to represent values in Python that can be understood. For example, using key-value pairs and strings to represent regions of a tic-tac-toe board.
Step3:  We will use data structures to create a representation of this board. Use string values to represent the nine spaces. The dictionary values will hold the X's and O's, and the position strings ('low-R') will be the keys.
Step4:  The keys are arbitrary; they are just used to store and change values. 
Machine version
Step5:  Human version
Step6:  How would we draw this board and include win conditions? Defining functions.
Step7:  Dictionaries, lists, and strings can be used in combination to simulate real world things, translating machine responses to human responses.
If confused about what type of data you're dealing with, use the type() function.
<ASSISTANT_TASK:>
Python Code:
cat = {'name' : 'Zophie', 'age': 7, 'color':'gray'}
Explanation: Lesson 17:
Data Structures
Lists and dictionaries organize data in structures for programs.
End of explanation
allCats = []
allCats.append({'name' : 'Zophie', 'age': 7, 'color':'gray'})
allCats.append({'name' : 'Fooka', 'age': 5, 'color':'black'})
allCats.append({'name' : 'Fat-tail', 'age': 5, 'color':'gray'})
allCats.append({'name' : '???', 'age': -1, 'color':'orange'})
print(allCats)
Explanation: A list of Dictionaries isa Data Structure.
End of explanation
from IPython.display import Image
Image(url='https://automatetheboringstuff.com/images/000003.png')
Explanation: The Tic-Tac-Toe Game Program
We can use data structures to represent values in Python that can be understood. For example, using key-value pairs and strings to represent regions of a tic-tac-toe board.
End of explanation
import pprint
theBoard = {
    'top-L':' ',
    'top-M':' ',
    'top-R':' ',
    'mid-L':' ',
    'mid-M':' ',
    'mid-R':' ',
    'low-L':' ',
    'low-M':' ',
    'low-R':' ',
}
pprint.pprint(theBoard)
Explanation: We will use data structures to create a representation of this board. Use string values to represent the nine spaces. The dictionary values will hold the X's and O's, and the position strings ('low-R') will be the keys.
End of explanation
theBoard['mid-M'] = 'X'
pprint.pprint(theBoard)
Explanation: The keys are arbitrary; they are just used to store and change values. 
Machine version:
End of explanation
from IPython.display import Image
Image(url='https://automatetheboringstuff.com/images/000008.png')
Explanation: Human version:
End of explanation
def printBoard(board):
    print(board['top-L'] + ' | ' + board['top-M'] + ' | ' + board['top-R'])
    print('----------')
    print(board['mid-L'] + ' | ' + board['mid-M'] + ' | ' + board['mid-R'])
    print('----------')
    print(board['low-L'] + ' | ' + board['low-M'] + ' | ' + board['low-R'])
    
printBoard(theBoard)
Explanation: How would we draw this board and include win conditions? Defining functions.
End of explanation
print('type(42)')
print(type(42))
print('type(hello)')
print(type('hello'))
print('type(3.14)')
print(type(3.14))
print('type(theBoard)')
print(type(theBoard))
print('type(theBoard[top-R])')
print(type(theBoard['top-R']))
Explanation: Dictionaries, lists, and strings can be used in combination to simulate real world things, translating machine responses to human responses.
If confused about what type of data you're dealing with, use the type() function.
End of explanation
<END_TASK>