Skip to content

Instantly share code, notes, and snippets.

@chelesergiu
chelesergiu / lexicon.py
Created April 4, 2020 12:07
LPTHW Exercise 48, my lexicon.py version
def scan(sentence):
direction = ('north', 'south', 'east', 'west', 'down', 'up', 'left', 'right', 'back')
verb = ('go', 'stop', 'kill', 'eat')
stop = ('the', 'in', 'of', 'from', 'at', 'it')
noun = ('door', 'bear', 'princess', 'cabinet')
# create a tuple named 'number' which consists of integers from 0 till 100000
number = tuple(range(0, 100001, 1))
# convers the tuple elements into strings
number = tuple(map(str, number))
error = ('ASDFADFASDF', 'IAS')