2.identifier and Keywords
2.identifier and Keywords
name. a = 10
By mistake if we are using any other symbol like $ then we will get syntax
error.
cash = 10 √
ca$h =20
123total
total123 √
total=10
TOTAL=999
print(total) #10
print(TOTAL) #999
Identifier:
1. Alphabet Symbols (Either Upper case OR Lower case)
6. There is no length limit for Python identifiers. But not recommended to use too
lengthy identifiers.
1) 123total
2) total123 √
3) java2share √
4) ca$h
5) _abc_abc_ √
6) def
7) if
Note:
Eg:__add ___
Reserved Words
In Python some words are reserved to represent some meaning or functionality. Such
type of words are called Reserved words.
True,False,None
and, or ,not,is
if,elif,else
while,for,break,continue,return,in,yield
try,except,finally,raise,assert
import,from,as,class,def,pass,global,nonlocal,lambda,del,with
Note:
1. All Reserved words in Python contain only alphabet symbols.
2. Except the following 3 reserved words, all contain only lower case alphabet
symbols.
True
False
None
Eg: a= true
a=True √