7554425D-0054-440D-B95E-D2ABC13D62CD Created with sketchtool.
{body}
Your Saved Info Packages

View your saved Course or Program Packages containing pricing and detailed curriculum.

Speak with a Learning Advisor.

Have any questions? We'll call you.

Fill out the form below and a Learning Advisor will reach out at a time convenient for you.

Please pick a valid date and time between 9 AM and 8 PM eastern (Monday to Friday)

By clicking "Book a call," you accept our Terms and will also receive exclusive offers and updates about new courses, workshops and events.

Python Tutorial

Python Numbers

Ready to start your career in Data? Find out more about BrainStation's Python Course

Another data type used to store values in a variable is called a python number.

Python Number

Number data types have two major categories in Python. A number that does not contain a decimal point value is considered an integer or int. This is the first category within the number data type. A numeric value with decimal precision is called float or a floating-point number. This is the second category. Let’s try to use some int and float data types. Type the following code line-by-line in your notebook:

As shown above, we stored the numbers 30 and 7 in two different variables operand_one and operand_two. We also stored the outcome of dividing operand_one by operand_two in a variable called result. Now, when we check the value stored in the result it turns out to be a value with decimal point precision in it.

In order to check the type of data stored in a given variable, we use a helper function (more on functions later) called: type(value or variable name). Within the brackets we need to add what we are looking to evaluate. Let's examine how to use this. For example, if we want to check the type of data stored in a variable called operand_one, we will use this function as type(operand_one) and it will return the data type of the value stored in that variable. operand_one and operand_two are storing values of int type, and result is storing a value of float type.

Set Password

You already have an account with BrainStation, but you still need to set up a password.