How do I check if a string contains a substring in Python?

Using the ‘in’ operator : The in operator is the easiest and pythonic way to check if a python string contains a substring. The in and not in are membership operators, they take in two arguments and evaluate if one is a member of the other. They return a boolean value.

Sizin İçin Seçtik  How do you write a case insensitive in Python?

Leave a Reply

Your email address will not be published. Required fields are marked *