In python 3.5, how do I compare a string variable with part of another string?
<p>I'm currently learning Python and I have a question which I cannot find the answer too, currently I am trying to take a string variable given from the user and comparing it to part of another string. I want something like this:</p>

<blockquote>
  <p>Program: The given sentence is "I like chemistry", enter a word in the
  sentence given.</p>
  
  <p>User: like</p>
  
  <p>Program: Your word is in the sentence.</p>
</blockquote>

<p>I can only seem to make a program using the <code>if</code> function and <code>==</code> but this only seems to recognize that the two strings are similar if I type the full sentence given by the program.</p>

<p>From the some of the answers I have changed my program to but there seems to be an error I cannot find.</p>

<pre><code>sentence=("I like chemistry")
print("The given sentence is: ",sentence)
word=input("Give a word in the sentence: ").upper
while word not in sentence:
    word=input("Give a valid word in the sentence: ")
if word in sentence:
    print("valid")
</code></pre>