You are currently viewing How to use variables In Python

Python is very intelligent, in python, there is no need to define the data type of variable, simply you can assign the value to a variable by value it will recognize its data type.

Example:       

a=10   // Python will take it as an integer value

b="10" // Python will take it as string value

Here only we are assigning the value we are not declaring the variable data type.

 

Example 2:  Now we will create the simple Program to add two number to clear our variable thing.

a=10

b=20

c=a+b

print(c)

output: 30

Here we only define the value, not the data type.

Important: There is no need to terminate the line by putting semicolon which we do in another programming language. Like PHP, java,c ,c++

That’s it Folks on this topic. Let us know your comments on this article in the comment box below. Kindly like our Facebook page, follows us on Twitter and subscribe to our YouTube channel for latest updates.

Leave a Reply