Membership Comparisons

The operatorsinandnot intest for membership.x in sevaluates to true if x is a member of s, and false otherwise.

alphabet = "abcdefghijklmnopqrstuvwxyz"
string = "Python Programming/Strings"

print("The string contains:")
for letter in alphabet:
    if letter in string.lower():
        print(letter)

Output: 

The string contains:
a
g
h
i
m
n
o
p
r
s
t
y

results matching ""

    No results matching ""