Check sibling questions

Variables in Python refers to an object — an item or element that is stored in the memory.

They are containers used for storing data values . The values can be string, numeric or any combination of alphanumeric characters.

In Python we can use an assignment statement to create new variables and assign specific values to them. 

  • Variable declaration is implicit in Python, which means variables are automatically declared and defined when they are assigned a value the first time. 
  • Variables must always be assigned values before they are used in expressions as otherwise it will lead to an error in the program. 
  • Wherever a variable name occurs in an expression, the interpreter replaces it with the value of that particular variable.


  • gender = 'M' 
  • message = "Keep Smiling" 
  • price = 987.9


Learn in your speed, with individual attention - Teachoo Maths 1-on-1 Class

Ask a doubt
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh has done his B.Tech from Indian Institute of Technology, Kanpur. He has been teaching from the past 13 years. He provides courses for Maths, Science, Social Science, Physics, Chemistry, Computer Science at Teachoo.