QuestionQ3

Python Basics

Review this code:

Question Image

What output does it produce?

Explanation

<H unpacks two bytes as a little-endian unsigned 16-bit integer. The bytes \x01\x00 therefore decode to 1, and struct.unpack returns its results in a one-element tuple.

Community Discussion

No comments yet. Be the first to start the discussion!