How to search for words containg certain letters in a txt file with Python?
<p>Look at the code below. This finds the letter 'b' containing in the text file and prints all the words containing the letter 'b' right?</p>

<pre><code>x = open("text file", "r")
for line in x:
    if "b" and in line: print line

searchfile.close()
</code></pre>

<p>Now here is my problem. I would like to search with not only one, but several letters.
Like, a and b both has to be in the same word.
And then print the list of words containing both letters.</p>

<p>And I'd like to have the user decide what the letters should be.</p>

<p>How do I do that?</p>

<hr>

<p>Now I've come up with something new. After reading an answer.</p>

<p>x = open("text file", "r")</p>

<p>for line in x:
    if "b" in line and "c" in line and "r" in line: print line</p>

<p>Would this work instead?
And how do I make the user enter the letters?</p>
