The output of the following two Python codes are the same. [code]CODE 1 >>> re.split(r'(a)(t)', 'The night sky') CODE 2 >>> re.split(r'\s+',

The output of the following two Python codes are the same.
Code:
CODE 1
>>> re.split(r'(a)(t)', 'The night sky')
CODE 2
>>> re.split(r'\s+', 'The night sky')
A. True
B. False
 
Answer: b
Explanation: The output of the first code is: [‘The night sky’] whereas the output of the second code is:[‘The’, ‘night’, ‘sky’]. Clearly, the outputs of the two codes are different. Hence the statement given above is a false one.
 

Tìm kiếm

Back
Top