I've solved the problem by rewriting the function using filter():
for i in range(len(num)):
letters = numdict[int(num[i])]
namelist = filter(lambda w: w[i] in letters, namelist)
I am still puzzled as to why the previous function I wrote does not work, however. I have done extensive debugging and everything seems fine, except the output.
EDIT: Ooops, Sane: It looks like you were right. I was still trying to remove from the list I was iterating through... The working function is as follows:
nc = list(namelist)
for i in range(len(num)):
letters = numdict[int(num[i])]
for name in nc:
if name in namelist and name[i] not in letters:
namelist.remove(name)
