Introduction: Python - Using the "in" Operator
Python program that uses the "in" operator.
Code below and attached.
====================================
print ("Using the 'in' operator")
# "in" operator answers the question:
# Does first string appear in the second string?
WordEntered = input ("Enter a word: ")
LetterEntered = input ("Enter a letter: ")
#first string #second string
if LetterEntered in WordEntered:
print ("Letter:", LetterEntered, "is in the word at least once")
PhraseEntered = input ("Enter a phrase: ")
WordEntered = input ("Enter a word: ")
if WordEntered in PhraseEntered:
print ("Word:", WordEntered, "is in the phrase at least once")