Embercode
✕
StringsQuick quiz

Code points

6 questions. Covers Code points and emoji in Python strings.

Questions 1 to 5 of 6

  1. 1. What does len('😀') return for a string that holds one smiling face emoji?
  2. 2. Which expression returns the number of code points in a Python string s?
  3. 3. What does this program print? ``python mixed = 'a😀é' print(len(mixed)) print(len(mixed.encode('utf-16-le')) // 2) ``
  4. 4. What does this program print? ``python s = 'a😀b' print(s[:2]) print(len(s)) ``
  5. 5. True or false: the string é (one code point, U+00E9) and the string e followed by U+0301 (a combining accent) look the same on screen, so == returns True when they are compared.

5 question(s) left on this page.