string = 'ex@mple'
if '@' in string:
return True
if '@' not in string:
return False
myString = "<text contains this>"
myOtherString = "AnotherString"
# Casting to string is not needed but it's good practice
# to check for errors
if str(myString) in str(myOtherString):
# Do Something
else:
# myOtherString didn't contain myString
txt = "foobar"
print("foo" in txt)
if any(ext in url_string for ext in extensionsToCheck):
print(url_string)
any(not c.isalnum() for c in string)
str="Hello, World!"
print("World" in str) # True