<jupyter_start><jupyter_text>Python 3 - Cheat Sheet  Comparing Sequences and Other Types From [Comparing Sequences and Other Types](http://docs.python.org/tutorial/datastructures.htmlcomparing-sequences-and-other-types) in the Python tutorial:> The comparison uses lexicographical ordering: first the first two items are compared, and if they differ this determines the outcome of the comparison; if they are equal, the next two items are compared, and so on, until either sequence is exhausted.See also the Wikipedia article on [lexicalgraphical order](http://en.wikipedia.org/wiki/Lexicographical_order).  lists<jupyter_code>[5, 4, 3, 7] > [5, 4, 3, 2]
[5, 4, 3, 7] > [5, 4, 3, 8]<jupyter_output><empty_output><jupyter_text>list of tuples<jupyter_code>D = {'a': 2, 'd': 5, 'c': 3, 'b': 7}
sorted(D.items())
sorted(D.items()) > sorted([('a', 2), ('b', 7), ('c', 3), ('d', 3)])
('d', 5) > ('d', 3)
# since 5 > 3
('d', 9) < ('c', 9)
# since 'c' < 'd'<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1675178753830439, 'fraction_numerical': 0.031664964249233915, 'mean_word_length': 5.447368421052632, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '26768', 'license': 'MIT', 'n_tokens_mistral': 378, 'n_tokens_neox': 343, 'n_words': 117, 'path': 'Jupyter/Python3-Cheat_Sheet.ipynb', 'repo_name': 'radzak/Python-3-Cheat-Sheet', 'size': '979'}