MWZ

MINDWAREZONE

beginnerPython

What are variables in Python?

Answer

Clear, interview-ready explanation

A variable is a name that refers to an object or value in memory. Python creates a variable when a value is assigned to it, so its data type does not need to be declared explicitly.

name = "Aman"
age = 25
salary = 45000.50
            

Here:

  • name refers to a string.
  • age refers to an integer.
  • salary refers to a floating-point number.

Python also supports multiple assignment:

name, age, country = "Aman", 25, "India"
            

  Variable names are case-sensitive, so age and Age are different variables.