Exam GPYC All QuestionsBrowse all questions from this 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?

    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
mrmrmeOption: B

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