Explanation:
✅ 1. Importing the module
import re
Imports Python’s built-in regular expression module
Required to use pattern matching functions like match()
✅ 2. Using re.match()
clcoding = re.match(r"Python", "I love Python")
r"Python" → pattern we are searching for
"I love Python" → target string
re.match() checks ONLY at the start of the string
๐ It tries to match like this:
"I love Python"
↑
Start here
Since the string does NOT start with "Python", the match fails
✅ 3. Printing the result
print(clcoding)
Since no match is found → result is:
None
๐น Final Output
None

0 Comments:
Post a Comment