<jupyter_start><jupyter_text>Comparison Operators- binary operators: evaluate to a bool value- identity operations(is, is not): compares memory address- value comparisons (==, !=): compares values- ordering comparisons (, >=): doesn't work for all types- membership operations (in, not in): used with iterable types Numeric Types- value comparisons will work with all numeric types- mixed types (except complex) in value and ordering comparisons is supported  Code Examples  Comparison Operatorsbug using the is operator: juypter warnings<jupyter_code>0.1 is (3+4j)
3 is 3
[1, 2] is [1, 2]
"a" in "this is a test"
3 in [1, 2, 3]
3 not in [1, 2, 3]
"key" in {"key": 1}
1 in {"key": 1}
3 < 5
1+ 1j < 3 + 4j
from decimal import Decimal
from fractions import Fraction
4 < Decimal("10.5")
Fraction(2, 3) < Decimal("0.5")
0.1 == Decimal("0.1")
0.1 == Decimal(0.1)
4 == (4 + 0j)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12874583795782463, 'fraction_numerical': 0.051054384017758046, 'mean_word_length': 4.745222929936306, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 6, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '224092', 'license': 'MIT', 'n_tokens_mistral': 327, 'n_tokens_neox': 298, 'n_words': 128, 'path': 'python-deepdive/deepdive1/section04/section_04_comparison_operators.ipynb', 'repo_name': 'erictapia/devstacklab', 'size': '901'}