Variable in python

In this tutorial you will learn about variable in python which is act like container in programming and used to stored data value.

  • Variable is name that refers to value.
  • Assignment statement is used to create new variable and give value to that variable.

e.g.

>>>n=17
>>>pi=3.145
>>>name="ABC"

To display the value of variable, print statement is used

>>>print(n)
17
>>>print(pi)
3.145
>>>print(name)
ABC
Was this article helpful?
YesNo

Leave a Comment