The output of the following two Python codes are the same. [code]p = re.compile('hello') r = p.match('hello everyone') print(r.group(0)) r

Nguyễn Tân

New member
The output of the following two Python codes are the same.
Code:
p = re.compile('hello')
r = p.match('hello everyone')
print(r.group(0))
r = re.match('hello', 'hello everyone')
print(r.group(0))
A. True
B. False
 
Answer: a
Explanation: The two codes shown above are equivalent. Both of these codes result in the same output, that is: hello. Hence this statement is true.
 

Tìm kiếm

Back
Top