<jupyter_start><jupyter_text>Data TypesAs seen in the previous topic, there are data types in Python. We initially looked at an `int` anda `string`. We will discuss those and a couple others below. BooleanA `boolean` is essentially a binary value (meaning it has 2 potential values). Typically, booleansare used to represent `True` or `False`. Booleans are usually used in evaluating some sort oflogic, such as checking if variables are equal to each other.<jupyter_code>x = True                                   # x represents a Boolean (True)

print(f"x is True  -> {x is True}")        # True, because x = True

print(f"x is False -> {x is False}")       # False, because x = True<jupyter_output>x is True  -> True
x is False -> False<jupyter_text>Booleans can also be represented with numbers. 0 represents `False` while 1 (or any other number)represents `True`. StringAs seen before, a `string` represents 1 or more text characters that are wrapped with quotes. Thesequotes can be single `'` or double `"`, but the one that is used to start the string, must alsoend the string.<jupyter_code>x = 'this is a string'         # Valid String

y = "this is a string"         # Valid String

print(f"x == y -> {x == y}")    # True (Even though they use different quotations to start/end, they are equal)<jupyter_output>x == y -> True<jupyter_text>IntAn `int`, or integer, represents a whole number (positive or negative). Similar to numbers in reallife, we can run the general operations on them.<jupyter_code>x = 5                   # x has a value of 5

x = x + 10              # x has a value of 15

x = x * 2               # x has a value of 30

x = x / 3               # x has a value of 10.0
                        # if you don't want decimals from division, use //

x = x - 9               # x has a value of 1.0

# A shortcut of writing what we did above would be:
x += 3                  # equivalent to x = x + 3 (x has a value of 4.0)

x *= 2                  # equivalent to x = x * 2 (x has a value of 8.0)

print(f"x = {x}")<jupyter_output>x = 8.0
{'fraction_non_alphanumeric': 0.08636584182435711, 'fraction_numerical': 0.01455604075691412, 'mean_word_length': 2.5187713310580206, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '578573', 'license': 'MIT', 'n_tokens_mistral': 631, 'n_tokens_neox': 594, 'n_words': 299, 'path': 'lessons/lesson02-python-basics/data-types.ipynb', 'repo_name': 'nairraghav/Introduction-To-Python', 'size': '2061'}