The dictionary is undefined.
Here in DaniWeb you must but [CODE] and same with / before CODE as tags not simple square brackets.
Like this:
['scarcity', 'scarce', '[A],', 'ity', '[N|A]', '[N]']
scarcity scarce [A], ity [N|A] [N]
scarcity
[A],
['sweet', ',']
sweet ,
Traceback (most recent call last):
File "final3.py", line 69, in <module>
dict_pos = item[2]
IndexError: list index out of range This is what the code is:
for line in dictionary:
line = line.replace('(', ' ').replace(')', ' ')
item = line.split()
print item
print line
dict_word = item[0]
dict_base = item[1]
dict_pos = item[2]
print dict_word
if not dict_pos:
print "[X],"
else:
print dict_pos