Embercode
✕
Data Formats and TextQuick quiz

Bytes and characters

7 questions. Covers Unicode and UTF-8.

Questions 1 to 5 of 7

  1. 1. What does this print? ``python print(len("Zoë"), len("Zoë".encode("utf-8"))) ``
  2. 2. What does this print? ``python s = "€5" print(len(s), len(s.encode("utf-8"))) ``
  3. 3. What does this print? ``python print(len("e\u0301"), len("\u00e9")) ``
  4. 4. What does this print? ``python print(len("Hi 😀"), len("Hi 😀".encode("utf-8"))) ``
  5. 5. How many bytes does the Chinese character 中 take in UTF-8? Type the number.

    Type your answer.

5 question(s) left on this page.

Typed answers ignore extra spaces and, for most questions, capital letters.