Identifiers and Keywords in python
Python identifiers
A Python identifier is a name used to distinguish a variable, work, class, module or other article. An identifier begins with a letter start to finish or beginning to end or an underscore " _ " trailed by at least zero letters, underscores and digits "0 to 9".
Python doesn't permit accentuation characters, for example, @, $, and % inside identifiers. Python is a case touchy programming language. In this manner, Manpower and labor are two distinct identifiers in Python.
conventions for Python identifiers:-
->Class names start with a capitalized letter. Every single other identifier start with a lowercase letter.
->Beginning an identifier with a solitary driving underscore shows that the identifier is private.
->Beginning an identifier with two driving underscores shows an unequivocally private identifier.
->On the off chance that the identifier likewise finishes with two trailing underscores, the identifier is a language-characterized exceptional name.
Python keywords
Python has a lot of keywords that are saved words that can't be utilized as factor names, work names, or some other identifiers:
*if
*wait
*import
*else
*break
*continue
*and
*for
*as
*or
*yeild
*elif ...etc
Your can check the keyword in your IDLE by typing
import keyword
import (keyword.kwlist)
It will show your a list of keyword in python
True or false:-
Valid and False are truth esteems in Python. They are the aftereffects of correlation activities or sensible (Boolean) tasks in Python
For example:
3 == 3 3 == 2 6 > 3 9 <= 2 true false true false
Thankyou😀
No comments