Welcome To
Variables


Variables In Python

The python variables is a container store the some value inside the program after that value a access . the variable value can change during the run time . example the variable is a box then store the some items inside the box later we identify the box name and use that item like this. The variables is very Important part in python program . It is a technique to store the value inside the program .

Declaring Variable

The python variable no need to declare the data type explicitly . the interpreter understand that variable value and give the output . directly initial the value using = (equal sign) to assign the variable value.

Accessing The Variable

The variable access using the variable name . first we can assign the value to the variable.anywhere in te variable

Examples

myName="Darshan"
print(myName)# accessing the variable


output

Single Value Assign the Multiple variable

In python programming allows a declare or initialize the single value assigned to multiple variables. in single line that is shown below.

x=y=z=10
print(x)
print(y)
print(z)


output


Concatenating variable

python supports concatenation of variable like decimal, Binary,Octal, Hexadecimal,Float,boolean using + operator. python string also but the python won't support the string Concatenating with Integer the python interpreter gives error. that is shown below

x=10
y=10.11
a="darshan"
b="Coder"
z=10f
print(x+y)
print(x+z)
print(a+b)


output


Delect The Variable

The python allow to delect the variable by using del keyword syntax del variable name

myName="Darshan"
print(myName)
del myName
print(myName)


output