VARIABLES AND TYPES


VARIABLES AND TYPES

Variable is also a type of identifier in Python. It is a name that is used to store in a specific memory location.

Since Python is a multilevel programming language, it works on an interpreter and is also an infer language that is smart enough to get the type of variable without mentioning the type of datatype.

Variable are case sensitive.

RULES FOR NAMING THE VARIABLES:

  • The first character should start with an alphabet or an underscore(_).
  • All the characters except the first character need to be an alphabet of lower-case (a-z), upper-case (A-Z), underscore, or digit (0-9).
  • A variable shouldn’t contain any white space or special character (!, @, #, %, ^, &, *).
  • Variable names shouldn’t be similar to keywords of the Python programming language.
  • Variable names are case sensitive so var and VAR are completely two different variables and don’t contain the same information.

Example of valid variables

v45, _v, f_1, etc.

EXAMPLE OF INVALID VARIABLES

3g, m&6, n 0, etc.