Variables in Python Programming


In programming, a "variable" is a container in which a data value can be stored within the computer’s memory. The stored value can then be referenced using the variable’s name. Data to be stored in a variable is assigned in a Python program declaration statement with the = assignment operator. For example, to store the numeric value 25 in a variable named "a": Eg: a=25

  • Variables are containers for storing data values. Python has no command for declaring a variable.
  • A variable name must start with a letter or the underscore (_) character
  • A variable name cannot start with a number
  • A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _)
  • Variable names are case-sensitive (name, Name and NAME are three different variables)

Example for Valid Variables


name= "Ram"
User_name= "Ram"
name2= "Ram"



Learn All in Tamil © Designed & Developed By Tutor Joes