# Python Data Types: Categorization  and Exploration

Thank you for your continued support and engagement with our blog. We're exploring the [Python](https://www.programiz.com/python-programming/online-compiler/) Series further, building on our previous post. In our previous blog, we learned about

1. **Python**'s Introduction
    
2. **Features and Execution**
    
3. [**Python Virtual Machine**](https://www.gkindex.com/python-tutorial/python-virtual-machine.jsp)
    
4. [**Memory Management**](https://realpython.com/python-memory-management/)
    
5. [**Garbage Collection**](https://docs.python.org/3/library/gc.html)
    

<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text"><a target="_blank" rel="noopener noreferrer nofollow" href="https://blog.bytescrum.com/exploring-pythons-core-from-basics-to-behind-the-scenes" style="pointer-events: none">https://blog.bytescrum.com/exploring-pythons-core-from-basics-to-behind-the-scenes</a></div>
</div>

In this blog, we will delve into an in-depth exploration of [Python](https://www.tutorialspoint.com/python/index.htm) data types, accompanied by illustrative examples.

## Data Types

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1692776670878/ba6791de-e13e-4bd7-aa43-88d225b37536.png align="center")

[Data types](https://www.techtarget.com/searchapparchitecture/definition/data-type) are categorizations that define the value of a variable or expression in a computer language, specifying operations, [memory](https://www.tutorialsteacher.com/python/memoryview-method) requirements, and binary storage. They aid in understanding and modifying the variable's values.

[Python](https://www.codecademy.com/catalog/language/python)'s [data types](https://amplitude.com/blog/data-types) are divided into various categories, each of which serves a distinct purpose in programming and caters to diverse scenarios

<div data-node-type="callout">
<div data-node-type="callout-emoji">💡</div>
<div data-node-type="callout-text">Numeric Data Types in Python: Exploring Integers, Floats, and Complex Numbers</div>
</div>

## **Numeric Types**

These [data types](https://en.wikipedia.org/wiki/Data_type) deal with whole and decimal numbers. The [float type](https://www.geeksforgeeks.org/floating-point-representation-basics/) supports decimal values, allowing for exact computations. The [complex](https://www.prepbytes.com/blog/python/complex-data-type-in-python) type is used for more sophisticated mathematical operations, expressing integers with real and imaginary components.

### **Integer (int)**

* Integer [data types](https://www.w3schools.com/java/java_data_types.asp) for whole numbers without a decimal point, such as **<mark>5, -10, or 0</mark>**, are represented. To integer numbers, arithmetic operations such as addition, subtraction, multiplication, and division apply.
    
* Define two integer variables **a** and **b**, representing whole numbers, and perform basic arithmetic operations, showcasing int [data type](https://www.geeksforgeeks.org/data-types-in-c/) usage.
    
    ```python
    # Define integer variables
    a = 5
    b = -10
    
    # Perform arithmetic operations
    sum_result = a + b  # -5
    difference_result = a - b  # 15
    product_result = a * b  # -50
    division_result = a / b  # -0.5
    
    # Print the results
    print("Sum:", sum_result)
    print("Difference:", difference_result)
    print("Product:", product_result)
    print("Division:", division_result)
    ```
    
    ### [**Floating-Point**](https://www.geeksforgeeks.org/introduction-of-floating-point-representation/)**(**[**float**](https://docs.python.org/3/tutorial/floatingpoint.html)**)**
    
* [Floating-point](https://www.freecodecamp.org/news/floating-point-definition/#:~:text=A%20floating%20point%20number%2C%20is,float%22%20to%20any%20position%20necessary.)[data types](https://www.geeksforgeeks.org/data-types-in-c/) for decimal numbers or in exponential notation, such as **<mark>3.14 or -0.01</mark>**. [Floating-point](https://en.wikipedia.org/wiki/Floating-point_arithmetic) values are used for more precise numerical calculations.
    
    ```python
    # Define float variables
    pi = 3.14159
    negative_value = -0.01234
    
    # Perform calculations involving float values
    circumference = 2 * pi * 5  # Calculate circumference of a circle with radius 5
    area = pi * 5 ** 2  # Calculate area of the circle with radius 5
    distance = 10.5 + 3.75  # Calculate the sum of distances
    
    # Print the results
    print("Circumference:", circumference)
    print("Area:", area)
    print("Distance:", distance)
    ```
    
    [Floating-point](https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html) variables represent **<mark>π (pi)</mark>** and negative decimal values, enabling precise calculations like circumference, area, and distance summation in scientific and engineering applications.
    
    ### [**Complex**](https://www.scaler.com/topics/complex-in-python/)
    
* [Complex number](https://mc-stan.org/docs/reference-manual/complex-numerical-data-type.html)[data type](https://press.rebus.community/programmingfundamentals/chapter/data-types/), consisting of a real and imaginary part.
    
    ```python
    # Define a complex number
    z = 2 + 3j
    
    # Access the real and imaginary parts
    real_part = z.real  # 2.0
    imaginary_part = z.imag  # 3.0
    
    # Perform arithmetic operations
    addition = z + (1 + 1j)  # (3 + 4j)
    multiplication = z * (1 - 2j)  # (8 - 1j)
    
    # Conjugate of the complex number
    conjugate = z.conjugate()  # (2 - 3j)
    
    # Absolute value (magnitude) of the complex number
    magnitude = abs(z)  # 3.605551275463989
    
    print("Real Part:", real_part)
    print("Imaginary Part:", imaginary_part)
    print("Addition:", addition)
    print("Multiplication:", multiplication)
    print("Conjugate:", conjugate)
    print("Magnitude:", magnitude)
    ```
    
    A [complex number](https://www.geeksforgeeks.org/complex-numbers/)<mark>z </mark> has real and imaginary components, enabling fundamental arithmetic operations, accessing components, computing [conjugates](https://byjus.com/maths/conjugate/), and determining magnitude, showcasing their versatility in
    
    mathematical operations.
    

## [**Boolean**](https://developer.mozilla.org/en-US/docs/Glossary/Boolean)**Type**

* **Bool:**[**Boolean data type**](https://www.javatpoint.com/java-data-types)**for representing True or False values.**
    

```python
# Define boolean variables
is_sunny = True
is_raining = False

# Check conditions and perform operations based on boolean values
if is_sunny:
    print("It's a sunny day!")
else:
    print("It's not sunny today.")

if not is_raining:
    print("No need for an umbrella.")
else:
    print("Don't forget your umbrella!")

# Boolean operations
both_conditions = is_sunny and not is_raining  # True and True = True
either_condition = is_sunny or is_raining  # True or False = True

# Printing the results
print("Both Conditions:", both_conditions)
print("Either Condition:", either_condition)
```

[Boolean](https://www.techtarget.com/whatis/definition/Boolean#:~:text=In%20computing%2C%20the%20term%20Boolean,are%20used.) variables **<mark>is_sunny</mark>** and **<mark>is_raining</mark>** represent <mark>sunny</mark> or <mark>rainy </mark> conditions, controlling program flow and demonstrating operations using operators. [Boolean data types](https://dev.mysql.com/doc/refman/8.0/en/data-types.html) are essential for logical conditions and programming branching.

## **Sequence Types**

1. **List**: Mutable ordered collections of values.
    
2. [**Tuple**](https://www.techtarget.com/whatis/definition/tuple): Immutable ordered collections of values.
    
3. [**Range**](https://www.w3schools.com/python/ref_func_range.asp): Represents an immutable sequence of numbers.
    
4. **String(str)**: String also belongs to this category, as it is a sequence of characters.
    
    ### **String (str):** String data type for sequences of characters.
    

* Character sequences such as "Hello, [ByteScrum](https://blog.bytescrum.com/)!" or "[Python Series](https://blog.bytescrum.com/exploring-pythons-core-from-basics-to-behind-the-scenes)" are represented. Text may be manipulated and concatenated using string [data types](https://javascript.info/types).
    
* Utilize string variables for greeting messages, language names, and text manipulation in programming scenarios. Demonstrate string concatenation, index access, substring extraction, string length, and conversion to uppercase and lowercase.
    
    ```python
    # Define string variables
    greeting = "Welcome, ByteScrum!"
    language = "Python Series"
    
    # Concatenate strings
    message_output = greeting + "learning " + language +" is fun "
    # Welcome,ByteScrum learning Python Series is fun
    
    # Accessing characters by index
    first_char = greeting[0]  # 'W'
    second_char = greeting[6]  # 'e'
    
    # Slicing strings
    substring = language[0:3]  # 'Pyt'
    last_three_chars = greeting[-3:]  # 'um!'
    
    # Length of a string
    greeting_length = len(greeting)  # 19
    
    # Converting to uppercase and lowercase
    uppercase_greeting = greeting.upper()  # 'WELCOME, BYTESCRUM!'
    lowercase_language = language.lower()  # 'python series'
    
    # Printing the results
    print("Message Output:", message_output)
    print("First Character:", first_char)
    print("Second Character:", second_char)
    print("Substring:", substring)
    print("Last Three Characters:", last_three_chars)
    print("Length of Greeting:", greeting_length)
    print("Uppercase Greeting:", uppercase_greeting)
    print("Lowercase Language:", lowercase_language)
    ```
    
    ### **List:** Mutable ordered collections of values.
    
* [Lists](https://www.w3schools.com/python/python_lists.asp) are powerful data structures in [Python](https://my.newtonschool.co/register?hsa_acc=6133007348&hsa_cam=19798545760&hsa_grp=146113714479&hsa_ad=650803818373&hsa_src=g&hsa_tgt=kwd-1350444027&hsa_kw=python+for+beginners&hsa_mt=b&hsa_net=adwords&hsa_ver=3&gad=1&gclid=Cj0KCQjw3JanBhCPARIsAJpXTx5rpzkaBynOdloM9gQPvVrWFRxbvkfHMRQNkh4Wmeykl9dUWhOMvtgaAt42EALw_wcB&redirect=true&type=apply-form&hash=gos2ze8seake) that are commonly used for storing and manipulating ordered groups of objects.
    
* We've created a [list](https://www.geeksforgeeks.org/python-lists/) called **numbers** that contains numerous integer values. We show how to add an element, access elements by index, alter an element, remove an element by value, calculate the length of the [list](https://developers.google.com/edu/python/lists), verify the presence of a value in the [list](https://www.javatpoint.com/python-lists), and use a for loop to iterate over the [list](https://docs.python.org/3/tutorial/datastructures.html).
    

```python
                    
 # Define a list of numbers
 numbers = [1, 2, 3, 4, 5]
                    
 # Add an element to the end of the list
 numbers.append(6)
                    
 # Access elements by index
 second_number = numbers[1]  # 2
                    
 # Modify an element
 numbers[3] = 10
                    
 # Remove an element by value
 numbers.remove(3)
                    
 # Calculate the length of the list
 list_length = len(numbers)  # 5
                    
 # Check if a value is in the list
 is_in_list = 5 in numbers  # True
                    
 # Iterate through the list
 for num in numbers:
     print(num)
                    
 # Printing the results
 print("Modified List:", numbers)
 print("Second Number:", second_number)
 print("List Length:", list_length)
 print("Is 5 in the List:", is_in_list)
```

### [**Tuple**](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-tuples): Immutable ordered collections of values.

[Tuples](https://www.tutorialspoint.com/python/python_tuples.htm) are similar to lists, except they are immutable, which means that their elements cannot be changed after they are created. They are frequently employed when you want to ensure that the data remains constant during the execution of the application.

* We've created a [tuple](https://www.w3schools.com/python/python_tuples.asp) called **company** that has information on a company's name, **<mark>no_of_year</mark>**, and experience. We demonstrate indexing [tuple](https://www.dataquest.io/blog/python-tuples/) members, unpacking a [tuple](https://www.geeksforgeeks.org/tuples-in-python/) into independent variables, determining [tuple](https://www.programiz.com/python-programming/tuple) length, and concatenating [tuples](https://docs.python.org/3/tutorial/datastructures.html).
    
    ```python
    company = ("ByteScrum", 6, "Evolving Dynamics in IT Services")
    
    # Access elements by index
    name = company[0]  # "ByteScrum"
    no_of_years = company[1]   # 6
    experience = company[2] # "Evolving Dynamics in IT Services"
    
    # Unpack tuple into variables
    name, no_of_years, experience = company
    
    # Length of the tuple
    tuple_length = len(company)  # 3
    
    # Concatenate tuples
    services = ("WebServices", "MobileApps", "Blockchain")
    all_services = company + services  # ("ByteScrum", 6, "Evolving Dynamics in IT Services", "WebServices", "MobileApps", "Blockchain")
    
    # Printing the results
    print("Name:", name)
    print("No_Of_Years:", no_of_years)
    print("Experience:", experience)
    print("Tuple Length:", tuple_length)
    print("All Services:", all_services)
    ```
    
    ### [**Range**](https://www.programiz.com/python-programming/methods/built-in/range): Represents an immutable sequence of numbers.
    
    The [range](https://www.freecodecamp.org/news/python-range-function-example/) data type is widely used to create numerical sequences, especially where [memory](https://www.toppr.com/guides/python-guide/references/methods-and-functions/methods/built-in/memoryview/python-memoryview/) economy is critical.
    
* We've made a [range](https://cs.stanford.edu/people/nick/py/python-range.html) of numbers ranging from **0 to 4** (exclusive). The [range](https://pynative.com/python-range-function/) is then converted to a list for visualization reasons, and iteration across the [range](https://www.simplilearn.com/tutorials/python-tutorial/range-in-python) is demonstrated, computing the sum of numbers in the [range](https://www.javatpoint.com/python-range-function), checking for the presence of a number in the [range](https://www.coursera.org/tutorials/python-range), and determining the length of the [range](https://kandi.openweaver.com/?landingpage=python_all_libraries&utm_source=google&utm_medium=cpc&utm_campaign=promo_kandi_ie&utm_content=kandi_ie_search&utm_term=python_devs&gclid=Cj0KCQjw3JanBhCPARIsAJpXTx43JV7bolJLb6cjs4RPFc17h5leT0IxXJUNN4k_rqfvJ-NZID3mfyEaAhtHEALw_wcB).
    
    ```python
    # Create a range of numbers
    numbers_range = range(5)  # Creates a range from 0 to 4
    
    # Convert the range to a list for visualization
    numbers_list = list(numbers_range)  # [0, 1, 2, 3, 4]
    
    # Iterate through the range
    for num in numbers_range:
        print(num)
    
    # Sum of numbers in the range
    sum_of_numbers = sum(numbers_range)  # 10
    
    # Check if a number is in the range
    is_in_range = 3 in numbers_range  # True
    
    # Length of the range
    range_length = len(numbers_range)  # 5
    
    # Printing the results
    print("Range as List:", numbers_list)
    print("Sum of Numbers:", sum_of_numbers)
    print("Is 3 in the Range:", is_in_range)
    print("Range Length:", range_length)
    ```
    
    ## **Set Types**
    
    * [**<mark>Set</mark>**](https://www.w3schools.com/python/python_sets.asp): Unordered collections of unique values.
        
    * [**<mark>Frozenset</mark>**](https://www.studytonight.com/post/frozenset-in-python)<mark>:</mark> Immutable version of a set
        
        ### **Set**: Unordered collections of unique values.
        
        [Sets](https://www.geeksforgeeks.org/sets-in-python/) are used to hold collections of unique data, and they are especially effective for eliminating duplicates and performing [set](https://realpython.com/python-sets/)\-related activities quickly.
        
    * In this case, we've created a collection called prime\_numbers that contains unique prime numbers. We show how to add and remove items, verify the presence of a value in the [set](https://www.programiz.com/python-programming/set), calculate the set's length, execute [set](https://www.javatpoint.com/python-set) operations like intersection, and iterate through the set.
        
        ```python
        # Define a set of unique numbers
        prime_numbers = {2, 3, 5, 7, 11}
        
        # Add an element to the set
        prime_numbers.add(13)
        
        # Remove an element from the set
        prime_numbers.remove(3)
        
        # Check if a value is in the set
        is_in_set = 5 in prime_numbers  # True
        
        # Calculate the length of the set
        set_length = len(prime_numbers)  # 4
        
        # Perform set operations
        even_numbers = {2, 4, 6, 8, 10}
        intersection = prime_numbers & even_numbers  # {2}
        
        # Iterate through the set
        for num in prime_numbers:
            print(num)
        
        # Printing the results
        print("Is 5 in the Set:", is_in_set)
        print("Set Length:", set_length)
        print("Intersection:", intersection
        ```
        
        ### **Frozenset**: Immutable version of a set
        
    * [Frozenset](https://www.programiz.com/python-programming/methods/built-in/frozenset#:~:text=Python%20Sets-,Python%20frozenset(),as%20elements%20of%20another%20set.) is used when you want a [set](https://www.freecodecamp.org/news/python-set-how-to-create-sets-in-python/)\-like collection of values that cannot be modified after creation, ensuring their integrity throughout your program's execution.
        
    * [set](https://www.tutorialspoint.com/python_data_structure/python_sets.htm) named **vegetables\_set** that contains various **vegetables**. We then use the [<mark>frozenset</mark>](https://www.javatpoint.com/python-frozenset-function)<mark>()</mark> method to transform this [set](https://docs.python.org/2/library/sets.html) into a [frozenset](https://www.geeksforgeeks.org/frozenset-in-python/). The outcome is an immutable version of the original [set](https://www.tutorialspoint.com/python_data_structure/python_sets.htm) called **frozen\_vegetables**.
        
    * We demonstrate how to access [frozenset](https://www.w3schools.com/python/ref_func_frozenset.asp) items and check for the existence of specified **vegetables**. When you want a [set](https://www.datacamp.com/tutorial/sets-in-python)\-like collection of values that cannot be changed once they are created, [frozenset](https://www.scaler.com/topics/frozenset-in-python/) is used to ensure their integrity during the execution of your application.
        
        ```python
        # Define a regular set of vegetables
        vegetables_set = {"sweetcorn", "peas", "carrots"}
        
        # Convert the set to a frozenset
        frozen_vegetables = frozenset(vegetables_set)
        
        # Access elements in the frozenset (same as set)
        is_sweetcorn_in_frozen = "sweetcorn" in frozen_vegetables  # True
        is_carrots_in_frozen = "carrots" in frozen_vegetables  # True
        
        # Printing the results
        print("Is 'sweetcorn' in Frozen Set:", is_sweetcorn_in_frozen)
        print("Is 'carrots' in Frozen Set:", is_carrots_in_frozen)
        ```
        
        ## **Mapping Type**
        
        ### **Dictionaries:** Represents key-value pairs, also known as dictionaries.
        
    * A [mapping type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html) is a data type consisting of [key-value pairs](https://developer.apple.com/documentation/swift/keyvaluepairs), allowing for organized and efficient storage and retrieval of data.
        
    * In Python, the primary [mapping type](https://www.ibm.com/docs/en/ida/9.1?topic=editor-mapping-types) is a dictionary, which represents structured data and configuration settings.
        
    * [**Key-Value Pairs**](https://stackoverflow.com/questions/25955749/what-is-a-key-value-pair): **Keys** are unique identifiers used to label and access their associated values, while **values** are the actual data associated with keys, ranging from integers to lists.
        
        ```python
        # Define a dictionary of company information
        company_details = {
        "name": "BYTESCRUM TECHNOLOGIES PRIVATE LIMITED.",
        "industry": "Information Technology",
        "founded_year": 2017,
        "employees": "10-50",
        "headquarters": "Lucknow, Uttar Pradesh"
        }
                
        # Access values using keys
        company_name = company_details["name"]
        company_industry = company_details["industry"]
        founded_year = company_details["founded_year"]
        employee_count = company_details["employees"]
        headquarters_location = company_details["headquarters"]
                
        # Modify values
        company_details["employees"] = "11-50"
                
        # Add a new key-value pair
        company_details["website"] = "https://www.bytescrum.com/"
                
        # Check if a key is in the dictionary
        has_year_key = "founded_year" in company_details
        has_products_key = "products" in company_details
                
        # Printing the results
        print("Company Name:", company_name)
        print("Industry:", company_industry)
        print("Founded Year:", founded_year)
        print("Employee Count:", employee_count)
        print("Headquarters Location:", headquarters_location)
        print("Updated Company Details:", company_details)
        print("Has 'founded_year' Key:", has_year_key)
        print("Has 'products' Key:", has_products_key)
        ```
        
        * ## **Binary Types**
            
            * **Bytes**: Immutable sequences of bytes.
                
            * **Bytearray**: Mutable sequences of bytes.
                
            * **Memoryview**: Used for advanced memory manipulation.
                
            
            ### **Bytes**: Immutable sequences of bytes
            
            In [Python](https://www.python.org/), [bytes](https://www.techtarget.com/searchstorage/definition/byte) are an immutable data type that represents a series of bytes. [Bytes](https://en.wikipedia.org/wiki/Byte) are used to store binary data such as photos, music, and other non-textual data. Because [bytes](https://www.britannica.com/technology/byte) are immutable, their values cannot be modified once they are created.
            
        * **Example:** Represents the **ASCII**\-encoded [bytes](https://web.stanford.edu/class/cs101/bits-bytes.html) for "Hello"
            
            ```python
            data = b'\x48\x65\x6c\x6c\x6f'  # Represents the ASCII-encoded bytes for "Hello"
            ```
            
            ### **Bytearray**: Mutable sequences of bytes.
            
        * Bytearrays are similar to [bytes](https://www.khanacademy.org/computing/computers-and-internet/xcae6f4a7ff015e7d:digital-information/xcae6f4a7ff015e7d:bits-and-bytes/a/byte-sized-bits), except they may be changed. This means that the values of individual [bytes](https://www.geeksforgeeks.org/understanding-file-sizes-bytes-kb-mb-gb-tb-pb-eb-zb-yb/) inside a bytearray can be changed. It is frequently used when binary data must be manipulated in situ, such as when decoding or encoding protocols.
            
        * **Example:** Represents the **ASCII**\-encoded [bytes](https://www.webopedia.com/definitions/byte/) for "Hello"
            
            ```python
            data = bytearray(b'\x48\x65\x6c\x6c\x6f')
            data[0] = 0x58  # Changes the first byte to represent "X"
            #Xello
            ```
            
            ### **Memoryview:** Used for advanced memory manipulation
            
        * [Memoryview](https://docs.python.org/3/c-api/memoryview.html) is a built-in [Python](https://www.w3schools.com/python/) class that allows you to expose an object's buffer interface. It enables you to access an object's internal buffer (such as [bytes](https://computer.howstuffworks.com/bytes.htm), bytearray, or other array-like objects) without duplicating its content. This is beneficial for doing memory-efficient operations on huge data collections.
            
        * **Example:** Represents the **ASCII**\-encoded bytes for "Hello"
            
            ```python
            data = bytearray(b'\x48\x65\x6c\x6c\x6f')
            mem_view = memoryview(data)
            mem_view[1] = 0x75  # Changes the second byte to represent "u"
            #Hullo
            ```
            
            <div data-node-type="callout">
            <div data-node-type="callout-emoji">💡</div>
            <div data-node-type="callout-text">bytes, bytearray, and memoryview are required for dealing with binary data and duties such as parsing file formats, processing network packets, and handling other low-level data operations.</div>
            </div>
            
            **Note:** While bytes and bytearray are routinely used, [memoryview](https://www.geeksforgeeks.org/memoryview-in-python/) is more sophisticated and ideal for circumstances where direct access to [memory](https://www.programiz.com/python-programming/methods/built-in/memoryview) buffers is required.
            
            ## **None Type**
            
            * ### [**NoneType**](https://realpython.com/null-in-python/): Represents the absence of a value or a null value.
                
            * [NoneType](https://stackoverflow.com/questions/21095654/what-is-a-nonetype-object) is a data type in [Python](https://en.wikipedia.org/wiki/Python_(programming_language)) that represents the absence of a value or a null value.
                
            * It's frequently used to signify that a variable or expression, has no relevant data. In other words, assigning the value None to a variable indicates that the variable is not linked to any legitimate object or data.
                
            * None is commonly used to initialize variables before assigning a real value to them or as a return value for functions that do not explicitly return anything.
                
            
            ```python
            #define a function that doesn't return any value
            def print_greeting(name):
            print(f"Welcome, {name}!")
            
            #call the function
            result = print _greeting("ByteScrum")
            
            # the result value is None since the function doesn't have a return statment
            print("Result:", result) #Output: Result: None
            # Assign a variable the value  None to indicate absence of a value
            no_data = None
            #Check if a variable has a value or is None
            if no_data is None:
            print("variable has no data")
            else:
            print("Variable has data")
            ```
            
            The **<mark>print_greeting</mark>** function lacks a return statement, it returns [None](https://www.freecodecamp.org/news/typeerror-cannot-unpack-non-iterable-nonetype-object-how-to-fix-in-python/) and the variable **<mark>no_data</mark>** is assigned [None](https://www.freecodecamp.org/news/typeerror-cannot-unpack-non-iterable-nonetype-object-how-to-fix-in-python/) to indicate absence. The is [None](https://java2blog.com/nonetype-python/) check determines if a variable holds the value [None](https://appdividend.com/2022/06/15/what-is-nonetype-object-in-python/).
            

<details data-node-type="hn-details-summary"><summary>Summary</summary><div data-type="detailsContent">Python is a versatile programming language that excels in handling data, thanks to its wide range of data types and its organized categorization. These categories include numeric, text, boolean, sequence, set, mapping, binary, and None types. Numeric types handle integers, floats, and complex numbers, while text types enable textual manipulation. Boolean types navigate logic and control flow, while sequence types organize ordered collections. Set types organize unique elements, mapping types for key-value pairs, binary types handle raw data, and None types mark variables devoid of meaningful data. Python's data type categorization helps developers express ideas, build solutions, and manipulate data with finesse and precision.</div></details>

Stay tuned for upcoming blogs in our Python Series. Subscribe to our updates and share the knowledge with fellow enthusiasts. Explore the depths of Python's data types and harness their power for your programming endeavors.
