What is the output of the following code:
import re
pattern = re.compile(r'(d+)s(w+)')
result = pattern.findall('There are 5 apples and 3 oranges.')
print(result)
pattern = re.compile(r'(d+)s(w+)')
result = pattern.findall('There are 5 apples and 3 oranges.')
print(result)
A. [('5', 'apples'), ('3', 'oranges')]
B. An error will occur
C. [('5', 'and'), ('3', 'and')]
D. [('5', '3'), ('apples', 'oranges')]
Answer: Option A

Join The Discussion