#!/bin/python3.4# coding=utf-8 class lexicon(object): # direction = ['north', 'south', 'east', 'west'] # verb = ['go', 'stop', 'kill', 'eat'] # noun = ['door', 'bear', 'princess', 'cabinet'] # num = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0] # wordtypelist =…