How to call strings inside a list in Python : <p>So, I'm making a chat bot, and I want to enable it so if the user inputs a word/phrase thats in the dictionary (a pickled file), it will reply with a suitable message to what the user input. It might make more sense if you see the code:</p>

<pre><code>""" startup """ 

import pickle

'''opening the dictionary'''

inFile = open('words.txt', 'rb')
dictionary = pickle.load(inFile)

'''printing the dictionary'''

print("PRE TESTS...")

print("-")

print("Pickle protocol import:")
print(dictionary)

print("END OF PRE TESTS...")

print("-")
print(" ")

""" end of startup """

print("Hello! My name is Pinnochio. I'm currently very young, and my communication is extremely limited.")
print("-")

''' handling the replies '''

reply = input()

if reply != dictionary:
    print("Sorry, I don't know that word.")
    reply = input()





if reply == dictionary[0] | dictionary[1] | dictionary[2]:
    print("Hey there")
    reply = input()

if reply == dictionary[3]:
    print("I'm feeling great!")
    reply = input()

if reply == dictionary[4] | dictionary[5]:
    print("It is, isn't it?")
    reply = input()
</code></pre>

<p>The dictionary is a list inside another file, which I've pickled:</p>

<pre><code>import pickle

dictionary = ["hello", "hi", "hey", "how are you?", "good morning", "good afternoon"]

outFile = open('words.txt', 'wb')
pickle.dump(dictionary, outFile)
outFile.close()
</code></pre>

<p>Thanks in advance!</p>
