In this post we will learn about variables in python , let’s get started
Variable are used to store data values.
If you haven’t Install Python Yet go and Install it Install python .
In python there isn’t any command to declare a variable , The variable is declared the moment you assign value to it.
An example will help you to understand
a=5 b="Thecodehubs" print(a) print(b)
Output :
You don’t need to declare a variable with any particular datatype and you can change type by assigning a different datatype value
Lets take an example :
a=5 #a is type int a="Thecodehubs" # now a is type string print(a)
Output:
You can declare string variable by using single or double quotes
a='Nisarg patel' b="Thecodehubs" print(a) print(b)
Output :
Rules to declare variable name
Assign value to multiple variables
a,b,c='Nisarg patel','thecodehubs',3 print(a) print(b) print(c)
output:
That’s all folks for today stay tuned for more blogs 🙂
Checkout : List In python
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular
In this article, we have to show Create and Used PIPE in angular