Variables in python

Today we are going to discuss about variable and data types in Python language


In the previous tutorial we discussed about the usability and advanced functionalities of python and why big companies consider to make programs in Python .

if you did not access the tutorial then click here and see the tutorial first so that you can understand this tutorial easily. without any further delay let’s get started in this tutorial.


So what are variables ?


Variables are nothing but containers where we can store values for the limited time and can be for permanent with a specific data type this is the inexact definition of variables. Variables can be defined in a programming language by just defining any word with specific data type developers consider to make meaningful variables based on the allocated task to the variables for easy finding purpose.


Generally while declaring a variable you need also to declare the datatype of the variable but in Python you don’t need to declare the data type of the variable it doesn’t mean that in Python there are no data types it’s not that right at all there are data types in Python but you don’t need to declare that . Python automatically identifies the data type of your variable you declared before , so that there is no need to declare the data type but you can change the data type in Python in which you are willing to convert.

The data type word comes too much time right ?


If you are confused about data types then don’t worry I will clarify that for you now that we will discuss about what data types are in programming languages.

Generally in programming languages there are many types of data types. Some of them are int, str, double long etc . But in terms of the main data types of any programming language there are int str char float bool etc. The data types are basically used to clarify the type of any variable data used in programming languages . There are many kinds of data types because each data type consumes memory for their allocated memory size. In some cases it can be  high and in some low it is different because of their work functionality. In Python variables can be declared as mentioned below :


  a = “hello”    (string)

  b  = 2      (int)

  c = 10.5        (float)

  d  = True       (bool)

  e  = “c”          (char)


I used to make quotes in Visual Studio code. An open source fully-fledged IDE from Microsoft. If you want to download Visual Studio code then follow the link below. Now the code to declare a variable is mentioned below.


There are many data types in Python three types are :

  1. Str 
  2. Int 
  3. float 
  4. complex 
  5. list 
  6. tuple 
  7. range 
  8. dict 
  9. set 
  10. frozenset 
  11. bool 
  12. bytes 
  13. bytearray 
  14. memoryview 


You can use all the data types in Python language. We will see each of them in detail in another tutorial, in upcoming tutorials.

That’s all for now see you in the next tutorial until then stay tune with me and don’t forget to get signed up.


Thank you,


From: Sayantan Biswas

Spread To Friends

9 thoughts on “Variables in python”

Leave a Comment