title: how to find a string in a txt file
body: <p>how do i find a string or a list in a text file. If i have a text file filled with words only, random words, not sentences, how do i find a string inside it. lets say I take a user input, how do I test or check if the string input by the user exist in the text file.</p>
  
  <p>so far i have this:</p>
  
  <pre><code>x = open('sample.txt')
  
  for a in x:
      b = a.split()        #converts the string from the txt to a list
  
  c = input('enter: ')        #user input
  
  if any(c in a for a in b):
      print('yes')
  </code></pre>
  
  <p>want to make a simple spellchecker. so from the user input string i want to check if that string matches the strings/list in the txt file </p>