Variables : variables are the containers used for referring to the data items. These are the reference points
which refers to the memory address where the data item is stored.
e.g
Name = “Divya”
Rules of naming a variable :
‘’’
- A variable name includes only alphabets, numbers and underscore. No other characters are allowed.
- A variable name should always start with an alphabet or underscore.
- special characters (other than underscore) and spaces are not allowed in the variable name.
- A variable name cannot be a Python keyword.
‘’’
Some methods for naming multi-word variable name
‘’’
- camel case - In camel case, each word other than first, starts with a capital letter and rest of the letters
are in small case.
e.g firstName = “Divya”
myFirstVariable = “Variable”
- pascal case = In pascal case, each word, starts with a capital letter and rest of the letters
are in small case.
e.g FirstName = “Divya”
MyFirstVariable = “Variable”
- Snake case - In snake case, each word is seperated by an underscore.
e.g snake_case = “This is snake case”
‘’’