<jupyter_start><jupyter_text>Types Checking Types using `type` We have seen that data in Python can be classified as belonging to a specific **type**, e.g.- `1` is an **integer**.- `5.2123` is a **floating-point number**.- `"Tuesday"` is a string.We can check the **type** of a data value using the `type` **function**.<jupyter_code>type(1)
type(5.2123)
type("Tuesday")<jupyter_output><empty_output><jupyter_text>This also works for `None`:<jupyter_code>type(None)<jupyter_output><empty_output><jupyter_text>And even for functions:<jupyter_code>type(print)<jupyter_output><empty_output><jupyter_text>Numeric data types**integers** and **floating-point numbers** are both examples of **numeric** data types. Python also has a built in **complex** data type that can be used for working with complex numbers. Complex numbers in python are written using `j` to denote the imaginary component:<jupyter_code>5 + 3j
type(5 + 3j)<jupyter_output><empty_output><jupyter_text>Boolean dataThe other simple data type we will be working with a lot is the `bool` type, which represents [**Boolean**](https://en.wikipedia.org/wiki/George_Boole) or "logical" data. **Boolean** data can take one of two values: `True` or `False`.<jupyter_code>type(True)
type(False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12832550860719874, 'fraction_numerical': 0.012519561815336464, 'mean_word_length': 6.944099378881988, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 1, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '290274', 'license': 'CC-BY-4.0', 'n_tokens_mistral': 427, 'n_tokens_neox': 409, 'n_words': 136, 'path': 'CH40208/python_basics/types.ipynb', 'repo_name': 'pythoninchemistry/ch40208', 'size': '1278'}