How to query python list with multiple characters in each one
<p>I know the title is a little messy and if someone wants to fix it, they are more than welcome to.</p>

<p>Anyways, I'm having trouble querying a python list with multiple values, I have looked on other Stackoverflow questions and none of seem to match what I'm looking for.</p>

<p>So, this is the code I have so far, its supposed to use a for loop statement, so that it goes through each character and then uses and if in statements to check whether a character in the user input matches anything in the list.</p>

<p>In my example, it only uses symbols, but hopefully that shouldn't be much of a problem</p>

<p>Anyways here is the code</p>

<pre><code>string = input("What symbol character would you like to check")
symbols=[' ', '!', '#', '$', '%', '&amp;', '"', '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '&lt;', '=', '&gt;', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~',"'"]
def symbol():
    for string in symbols:
        if string in symbols:
            return True
        elif string not in symbols:
            return False

if symbol():
    print('ok')
if not symbol():
    print('What Happened?')
</code></pre>

<p>*Update, I also need solution to be able to accept letters and numbers as well as the symbols.</p>

<p>For example, if user enters !a, that it will still detect the '!' and evaluate to True.</p>