Question: what is the difference between both the output(search and findall)?
Answer: Here you can see that, search() method is able to find a pattern from any position of the string. The re. ... It searches from start or end of the given string. If we use method findall to search for a pattern in a given string it will return all occurrences of the pattern.