About Python And Types of variable in Python

Share:
About Python

Python is an easy and a popular language witch made by Guido van Rossum this programming language can be used for beginner programmers and professional programmers. This programming language is popular because two main reasons the first one is the simplicity of this programming language that is so easy to learn than other programming languages, like if we want to print something we just have to write half of a line to do that for example: print(“Hello World”) this small code will print for us anything that we write them among double citation like now it will print the very common first code Hello World massage for us, and the second reason of the popularity is the power of this language python is very powerful and can be used for about all things like web developing, game making, creating PC applications and etc…
Now that we know enough about python it is time to go for our main subject witch is a very important subject in learning of all programming language the subject is variables in this section we will talk about: What is variables and Types of variables.
Variable:
Variables are place holders, that means we make variables to hold a place on our storage with a proper name. we can use them later in the codes or assign them to another value later. The good thing about variables in python is the flexibility of python with variables, Python will know it self the type of our variable by its value even if we change the value of a variable from one type of variable to another python will not complaint and python will make that variable suitable with new value, here I will tell an example for that from C++ and Python to define a variable and writing codes on that.

Example of C++

    #include<iostream>
    int main()
   {
          int variable_name = 0;
          return 0;
   }

Example of Python

    variable_name = 0

Now that we know about definition of variables so let’s learn about types of variable in python.
We have 8 types of variable in python which are in below:
    1: int (Integer)
    2: float (Floating point)
    3: str (String)
    4: list
    5: dict (Dictionary)
    6: tup (Tuple)
    7: set
    8: bool (Boolean)
It was the main concept of variables in python I will write about every type of variables in python with a lot of details so follow me to be aware of my activities.

No comments