nerdexam
GIAC

GPYC · Question #29

What is the output when the following commands are typed in Python interactive mode? >>> import re >>> re.findall(r"tag.*tag", "i want tag to go tag to sans tag")

The correct answer is A. ['tag to go tag', 'to sans tag']. You've hit your limit · resets 1pm (America/New_York)

Web Scraping & Forensics with Python

Question

What is the output when the following commands are typed in Python interactive mode?
import re re.findall(r"tag.*tag", "i want tag to go tag to sans tag")

Options

  • A['tag to go tag', 'to sans tag']
  • B['tag to go tag', 'to sans tag']
  • C['tag to go tag']
  • D['tag to go tag to sans tag']

How the community answered

(45 responses)
  • A
    84% (38)
  • B
    2% (1)
  • C
    4% (2)
  • D
    9% (4)

Explanation

You've hit your limit · resets 1pm (America/New_York)

Topics

#regular expressions#re module#greedy matching#findall

Community Discussion

No community discussion yet for this question.

Full GPYC Practice