[code=python]
>>>
>>> f=open("dict.tx t","r")
>>> word='zygote'
>>> for line in f:
if word in line:
print "Your word is in the dictionary"
Your word is in the dictionary
Your word is in the dictionary
Your word is in the dictionary
Your word is in the dictionary[/code]
Python displays that in my dictionary, there are 4 words that have 'zygote' in them, although I'm simply looking if the word 'zygote' itself is in the dictionary...an y suggestions on how I can fix my code?
>>>
>>> f=open("dict.tx t","r")
>>> word='zygote'
>>> for line in f:
if word in line:
print "Your word is in the dictionary"
Your word is in the dictionary
Your word is in the dictionary
Your word is in the dictionary
Your word is in the dictionary[/code]
Python displays that in my dictionary, there are 4 words that have 'zygote' in them, although I'm simply looking if the word 'zygote' itself is in the dictionary...an y suggestions on how I can fix my code?
Comment