Identifiers in Pyhton



 A Python identifier is a name used to identify a variable, function, class, module or other object. An identifier starts with a letter A to Z or a to z or an underscore (_) followed by zero or more letters, underscores and digits (0 to 9).

Python does not allow punctuation characters such as @, $, and % within identifiers. Python is a case sensitive programming language. Thus, Manpower and manpower are two different identifiers in Python.

Here are naming conventions for Python identifiers −

  • Class names start with an uppercase letter. All other identifiers start with a lowercase letter.
  • Starting an identifier with a single leading underscore indicates that the identifier is private.
  • Starting an identifier with two leading underscores indicates a strongly private identifier.

If the identifier also ends with two trailing underscores, the identifier is a language-defined special name. It may be available only through public import syntax [6]. In addition we have some notation indicating which operators these include: prefix - operator precedence, + operator modulus. Each of these modifiers has several possible meanings when evaluating expressions involving them along their respective directions from leftmost down the list − eg "+" / "-" = "-". This section describes each modifier individually so you can think of it like 'list of integers'. For example there might exist valid suffix/prefix combinations where one operation works while another doesn't work at all.. These words will make your head spin 😉 We discuss those further below – just know they cannot happen naturally anyway.

For more such blogs stay tuned to https://bloggerhut1235.blogspot.com

Comments

Popular posts from this blog

Best Career Opportunities After BCom Hons.

Namespaces in Python