Skip to content

Python code snippet – How to check if item is in the variable ?

a ="item"
if "i" in a :
  print("found in list")
else:
  print("not in list")
See also  How to use random tree in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.