# Python Numeric Types

**URL:** <https://forum.networklessons.com/t/python-numeric-types/10050>\
**Category:** Lessons Discussion\
**Created:** [February 27, 2020, 2:53pm UTC](https://forum.networklessons.com/t/python-numeric-types/10050 "2020-02-27T14:53:38Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)\
**Post date:** [June 2, 2020, 10:42am UTC](https://forum.networklessons.com/t/python-numeric-types/10050/3 "2020-06-02T10:42:33Z")

</div>

Hello Pradyumna

The code in this particular example is as follows:

`my_integer = 1.9`

The above code creates a variable called `my_integer` and assigns it a value of **1.9**. This will automatically make this variable a **float** type because it is not an integer, but a real number.

`type(my_integer)`

This code causes output that indicates the type of variable that `my_integer` is. You can see this returns the following text: **\<class ‘float’\>** so it is verified that the `my_integer` variable is of **float** type.

`my_int = int(my_integer)`

The above code takes the `my_integer` variable, which is of type **float** , and converts it to an **integer** , and stores it in the `my_int` variable. The result is that the `my_int` variable now contains an integer of value **1**. Remember that whenever a float type is converted to an integer type, the result is a “floored” value, meaning any decimal digits are simply removed.

If you add the following code, you can print out the value of the `my_int` variable:

print(my\_int)

From the below screenshot you can see that this value is indeed 1.

 ![image](https://cdn-forum.networklessons.com/uploads/default/original/2X/d/d36548b51aa408cb80543c178e939ebcdb50c6a3.png)

`type(my_int)`

Finally, the above code returns the type of variable that `my_int` is which is an **integer**.

I hope this has been helpful!

Laz

---

_[View the full topic](https://forum.networklessons.com/t/python-numeric-types/10050)._
