- in
in string
Check if a substring is in the string?
examples/strings/in.py
txt = "hello world" if "wo" in txt: print('found wo') if "x" in txt: print("found x") else: print("NOT found x")
found wo NOT found x
Check if a substring is in the string?
txt = "hello world" if "wo" in txt: print('found wo') if "x" in txt: print("found x") else: print("NOT found x")
found wo NOT found x