- in
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
in string
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