title: what does 'if x.strip( )' mean?
body: <p>So I was having problems with a code before because I was getting an empty line when I iterated through the foodList. </p>
  
  <p>Someone suggested using the 'if x.strip():' method as seen below. </p>
  
  <pre><code>for x in split:
    if x.strip():
      foodList = foodList + [x.split(",")]
  </code></pre>
  
  <p>It works fine but I would just like to know what it actually means. I know it deletes whitespace, but wouldn't the above if statement be saying if x had empty space then true. Which would be the opposite of what I wanted? Just would like to wrap my ahead around the terminology and what it is doing behind the scenes. </p>