Embercode
✕
StringsQuick quiz

Ordering

6 questions. Covers Lexicographic comparison in Python.

Questions 1 to 5 of 6

  1. 1. What does this program print? ``python words = ['b', 'B', 'ab', 'a'] words.sort() print(words) ``
  2. 2. What does this program print? ``python print('apple' > 'app') print('Zebra' > 'apple') ``
  3. 3. True or false: '10' < '9' is True.
  4. 4. True or false: sorted(['Apple', 'apple']) puts apple before Apple.
  5. 5. Which key function sorts a list of names ignoring case, and still gives the same order every time when two names differ only in case?

5 question(s) left on this page.