A variable is a name that stores a value, like a container that holds information
Key features of Variables:
1. It stores data. (names, text, etc.)
2. Values can change anytime.
x=5
x = 10 {Previously x held 5 now its holding 10}
Each variable has unique names.
3. Can stores numbers which can be used in mathematical operations.
A=5
B=6
Sum = A + B
4. Can store different data types.
Rules for naming variables:
1. Variable names must start with a letter (a-z)/(A - Z) or an underscore (_)
Name = “Alice” variable
_name = “Alice” variable
1name = “Alice” not a variable
@name = “Alice” not a variable
2. Variable names must contain letters and numbers and underscore (_) but no special characters
like @#$%
na_me = “Alice” variable
age1 = 23 variable
age@ = 23 not a variable
3. Variable names are case sensitive (Uppercase and lowercase are different)
Name = “Alice”
name = “Bob”
4. No spaces are allowed in variable names. Use underscore(_) instead.
Full name = “Abrar Faiaz” not a variable
Full_name = “Abrar Faiaz” variable
5. Some words are used in python that are reserved words and have special meaning. Those
cannot be variable names.
False, None, True, and, break, class, for, from, if