GPYC Exam QuestionsBrowse all questions from this exam

GPYC Exam - Question 29


Variable `traffic` contains a Scapy packet list. A programmer runs the following command: p1=traffic[1]

Which of the following describes the contents of p1, with respect to the `traffic` packet list?

Show Answer
Correct Answer: B

When accessing an element from a Scapy packet list using an index like `traffic[1]`, the operation retrieves the specific packet at that position within the list. Hence, `p1=traffic[1]` assigns the contents of the second packet in the `traffic` packet list to the variable `p1`.

Discussion

1 comment
Sign in to comment
mrmrmeOption: B
Sep 1, 2024

PacketList[<packet number>][<Layer name>].<field>