what would be the result of len(match.groups()) of a match of (a)(b(?:c)(d)(?:e))? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what would be the result of len(match.groups()) of a match of (a)(b(?:c)(d)(?:e))?

The method groups() returns all groups up from 1. so here the first group is b next group is d remaining are non capturing groups so the answer is 2 but here it can allow 3 for the right answer so can you explain?

18th Nov 2018, 12:39 PM
K Mayuri
K Mayuri - avatar
0 Answers