Variables and Data Types In Python

Anurag Verma
2 min readJul 12, 2021

Introduction to Variables
In this short article, we are going to discover python variables and data types. In general, variables are used to keep the value. Variable can store only one value at a time. The value might change throughout the runtime. We can designate several values to a variable but one worth at a time. Whenever we assign some worth to the variable that is kept in the main memory. We can also say that variable is nothing but a place or space in the main memory. Python variables and information types are essential aspects in shows due to the fact that we need to state the variable before using it. However we don’t write the information type as python immediately recognizes the type of the information by observing the worth assigned to it.
Let’s comprehend this principle with a basic example. There is a bookshelf. There are different compartments on the shelf. You can put the variety of books on the shelf and can take out any book from the rack. In this case, we can think about the bookshelf as the main memory and the compartments on the shelf as a variable name. The variety of books we save in the compartment can be considered as a value assigned to the variable that may change often.
In python we can designate worth to a variable in the following way:
X= 10.
There are some rules for calling a variable they are as follow:.
The variable name can have alphanumeric characters; just no special sign except highlight (_) is permitted. E.g. student_name1 is a legitimate variable name.
Python is a case-sensitive language that’s why different cases have a various meanings. E.g. name and NAME will be considered as various variables.
Space in between the variable names is not enabled. E.g. student name is not a valid variable name. Instead, you can write it as a student_name.
Variable names need to always begin with a letter or a highlight. You can not start a variable name with a number. E.g. name1 or _ name1 is a legitimate variable name but 1name is invalid.

Python Variables and Data Types.

There are different types of variable in python. Python supports various information types. Following are some typical types of variable in python.
1. Integer/long information enter python.
2. Real/float.
3. Boolean.
4. String.
5. List.
6. Tuple.
7. Dictionary.

In this post, we have discovered the python variables and information kinds of the variables utilized in Python. Likewise, we have actually learned the rules utilized for calling the variables. We learnt more about various information types and how to examine the type of variable in python. Also, to alter the python variables and information kinds of the variables (type conversion).

--

--