Embercode
✕
StringsQuick quiz

Counting and cipher

7 questions. Covers Caesar cipher in Python.

Questions 1 to 5 of 7

  1. 1. What does this program print? ``python c = 'd' print(ord(c) + 1) print(chr(ord(c) + 1)) ``
  2. 2. What number does Python give for the letter 'a' when you call ord('a')? Give the number only.

    Type your answer.

  3. 3. A Caesar shift function uses this code: ``python def shift_lower(c, shift): return chr(ord('a') + (ord(c) - ord('a') + shift) % 26) ` What does shift_lower('a', -1)` return?
  4. 4. What does this program print? ``python print(-7 % 5) print(-1 % 5) ``
  5. 5. What is ord('z') - ord('a')? Give the number only.

    Type your answer.

5 question(s) left on this page.

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