title: .remove function not working with an 'if' check in lists
body: <p>I'm fairly new to programming and python itself- I'm trying to use the <code>.remove</code> function to delete an item from a list if it exists in that list (as to not get the nameError).</p>
  
  <pre><code>q = ["cat","dog","fish","hamster","horse"]
  
  #Request element name to delete from queue
  removeElement = input("Please type in the element name to remove from the queue: ")
  #Remove the given element from the list
  q.remove(removeElement) if 'removeElement' in q else None
  
  print(q)
  </code></pre>
  
  <p>Unfortunately, if I try and use the 'if' checker it the item isn't removed from my list- why is this and how can I fix this issue?</p>