The relational operators !=
, <
, <=
, ==
, >=
, and
>
can all be applied to sequences of the same type in Python.
Sequences are compared lexicographically, i.e., in "dictionary order". That is, the order the relative
order of two sequences is determined by their first elements, or their second elements if the first elements tie,
or the third elements if the second elements tie, etc. For example, 'beta'
is less than
'bravo'
because, while the first elements tie, the "e" in 'beta'
comes before the "r" in
'bravo'
. Nonexistent elements always compare as less than elements that exist. For instance,
'fox'
is less than 'foxtrot'
because, while the first three characters all tie, the
nonexistent character after the "x" in 'fox'
is treated as coming before the "t" in
'foxtrot'
.
Fill in the placeholders so that the actual outputs match the expected outputs.