Python Identifiers
A name in python program is called python identifiers
Eg : a=10 The identifiers only allowed character in python are :
- alphabet symbols(lower and upper)
- digit (0 to 9)
- underscore symboll(_)
- Identifer should not start with digits
- identifiers are case sensitive
- We cant use reserved word as identifiers
- There is no lenght limit for python identifiers but not recommended to use too lenghty identifer
- Dollor symbol is blocked or not allowed in python
Examples:-
- 123a ==>> worng identifier
- total123
- javatest
- ca$sh ==>> worng identifier
- _abc_def ==>> private variable(always start with undersocpe)
- def ==>> worng
- if ==>> worng
- __test ==>> (strongly Private variable)
- __add__ ==>> (Magic Method)
Comments
Post a Comment