Thirteen Years of Service
Posts: 37
Threads: 5
RE: Unit Test 11-27-2012, 12:41 AM
#2
Hello, please can someone help me still? the place i am having problem is the assert_equal can someone put me through?
•
Thirteen Years of Service
Posts: 37
Threads: 5
RE: Unit Test 11-28-2012, 12:19 AM
#4
Hello, thanks for your reply code below still getting the same problem
lexi = {'north': 'direction', 'south': 'direction', 'west': 'direction',
'east': 'direction', 'down': 'direction', 'up': 'direction',
'left': 'direction', 'right': 'direction', 'back': 'direction',
'go': 'verb', 'stop': 'verb', 'kill': 'verb', 'eat': 'verb',
'the': 'stop', 'in': 'stop', 'of': 'stop', 'from': 'stop',
'at': 'stop', 'it': 'stop', 'bear': 'noun', 'door': 'noun',
'princess': 'noun', 'cabinet': 'noun', '1234': 'number',
'3': 'number', '91234': 'number'
}
def words(stuff):
stuff = raw_input('> ')
words = stuff.split()
for word in words:
a_word = (('direction', 'north'), ('verb', 'go'), ('stop', 'the'))
b_word = (('noun', 'bear'), ('number', '1234'))
word = [a_word, b_word]
def scan(word):
word = lexi.get(word, 'error')
return word
•
Thirteen Years of Service
Posts: 37
Threads: 5
RE: Unit Test 12-05-2012, 12:47 AM
#10
Hello, thanks for your help i do appreciate but it seen i am unable to get it right still thanks .
•