Posts

Showing posts from June, 2020

Identifier and Naming convention in python

Image
Python Keywords:                                                                            Keywords are reserved words for defining the syntax and structure of the Python language. Hence, you can not use them as identifier when naming variables, functions, objects, classes, and similar items or processes. In python there are 33 keywords and avoid using them as identifier to avoid errors or exceptions: Python Identifier:                     An identifier is a name given to a variable, class, function, string, list, dictionary, module, and other objects. It  differentiate one entity from another. Rules for writting Identifier : 1. Identifier cab be combination of any lower and upper letter(a-z, A-Z), digits(0-9) and underscore(_). examples : Python, Python, _python,my_var, var9 etc.. 2. Identifier cannot start with digit. example:  9var -----> not a valid identifier.                 var_1 ----> valid identifier 3. Keywords cannot be used as identifiers. example: raise =1 <-- In