Identifiers is nothing but a combination of letters in lowercase (a to z) or uppercase (A to Z) or digits (0 to 9) or an underscore _ .
Rules for identifiers:
- Allow Alphabet symbol (Both Upper & Lower).
- Allow Digits (0 To 9)
- Allow Underscore (_). If we use other thing python will give error like ($,%)
- Identifier shouldn’t start with digits like 100hk = 200
- We cant take Reserved word’s as a Identifier. By mistake if we take Python will give error.
- Python is a Case sensitive.
- Total = 100
- total = 200
- In python both are different variable name’s Because of Python is a Case sensitive.
- 123total = 100 (Not Valid)
- total123 = 100 (Valid)
- java2share = 200 (Valid)
- ca$h = 300 (Not Valid)
- _abc_abc = 400 (Valid)
- def = 500 (Not Valid)
- with = 600 (Not Valid)