Python programming language supports regular expression. RegEx is a sequence of characters for matching with other strings.
Here, we are given an expression and key. And we have a program to check whether the key is present in the expression.
Let's take an example to illustrate the working of our solution,
Input:
key = "includehelp" ; expression = "learn programming at includehelp"
Output:
True
We will use the in method which checks for the presence of a substring in the string and returns a boolean value based on the comparison.
Python code:
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer