MCQOPTIONS
Saved Bookmarks
| 1. |
What is the output of the following? sentence = 'horses are fast' regex = re.compile('(?P\w+) (?P\w+) (?P\w+)') matched = re.search(regex, sentence) print(matched.groupdict()) |
| A. | {‘animal’: ‘horses’, ‘verb’: ‘are’, ‘adjective’: ‘fast’} |
| B. | (‘horses’, ‘are’, ‘fast’) |
| C. | ‘horses are fast’ |
| D. | ‘are’ |
| Answer» B. (‘horses’, ‘are’, ‘fast’) | |