home ~ socials ~ projects ~ rss

Check if a Python List Includes a String

October 2025
list = ["alfa", "bravo", "charlie"]

if "bravo" in list:
  print("Found it")
Output:
Found it
end of line
Share link:
https://www.alanwsmith.com/en/34/gj/wa/7i/?check-if-a-python-list-includes-a-string