Skip to main content
Engineering LibreTexts

6.7: The in operator

[ "article:topic", "authorname:severancec", "python (language)", "license:ccbyncsa" ]
  • Page ID
    3094
  • The word in is a boolean operator that takes two strings and returns True if the first appears as a substring in the second:

    >>> 'a' in 'banana'
    True
    >>> 'seed' in 'banana'
    False