GIAC Python Coder (GPYC) GPYC Question # 21 Topic 3 Discussion

GIAC Python Coder (GPYC) GPYC Question # 21 Topic 3 Discussion

GPYC Exam Topic 3 Question 21 Discussion:
Question #: 21
Topic #: 3

A .gif file has the following attributes:

Extension: .gif

Magic value for start of file: \x47\x49\x46

Magic value for end of file: \x3b

A small data file called "raw_data" contains one gif. Which of the following statements is most likely to successfully extract the file?


A.

reiindall(r\-\gif,raw_data)[0]


B.

re.match(r'('.gif )"',raw_data).group(1)


C.

re.search('\x47\x49\x46(')\x3b',raw_data)


D.

re.findall(r'\x47\x49\x46.-\x3b,,raw_data,re.DOTALL)[0]


Get Premium GPYC Questions

Contribute your Thoughts:


Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.