Explain membership operator in with example.
Question :
Explain membership operator in with example.
Membership operator in returns true if a character exists in the given string, and false other-wise. For example,
>>> str = "work Hard"
>>> 'w' in str
True
>>> 'work' in str
True
>>> 'work' in str
False # because w of work is in small case
>>> 'we' in str
False