A Python variable is a reserved memory location to store values. In other words, a variable in a python program gives data to the computer for processing. Every value in Python has a datatype. Different data types in Python are Numbers, List, Tuple, Strings, Dictionary, etc.
How do you define a variable in Python?
How to declare a variable in Python
- The first character of the variable can be an alphabet or (_) underscore.
- Special characters (@, #, %, ^, &, *) should not be used in variable name.
- Variable names are case sensitive. For example - age and AGE are two different variables.
- Reserve words cannot be declared as variables.
What is a variable called in Python?
A Python variable is a symbolic name that is a reference or pointer to an object. Once an object is assigned to a variable, you can refer to the object by that name.