Python check if string got a certain word (or combination of characters)
<p>Ok so I have this string (for example):</p>

<pre><code>var = "I eat breakfast."
</code></pre>

<p>What i would like to do is to check if that string has the letters "ea", and I wanted to be able to put those values into a list.</p>

<p>I tried using var[x] but I can only have one character at the same time and not a word right?</p>

<p>Use <code>word in sentence</code>. For example:</p>

<pre><code>&gt;&gt;&gt; 'el' in 'Hello'
True
&gt;&gt;&gt; 'xy' in 'Hello'
False
</code></pre>

<p>For your reference, check: <a href="http://kracekumar.com/post/22512660850/python-in-operator-use-cases" rel="nofollow">python <code>in</code> operator use cases</a></p>

python python-3.x