understanding identifiers – CSKC
Sign In

Search

Code Learning #PYTHON#8168    siteicon   siteicon  

understanding identifiers

There are some rules to name identifiers, which are used for variable names, function names, class names etc. For time being understand some basic rules.

Source Code

TC++ #8168

Source Code

×

Ask AI About This Code

Default Prompt that is passed along with the code is given below, You can write your own prompt if you so desire.



×

Test Python

Notes

  • Identifier of any length
  • Only alphabets, numbers (not in beginning) or underscore allowed
  • No other special characters allowed
  • Can not use keywords (like for, while etc)
  • Names are case-sensitive. (ABC, aBc, Abc are all different names)
  • Camelcase (first letter of first word lowercase, first letter of subsequent word uppercase) type   for variable and function names,  examples: var, myVar, my_var
  • Title case (first letter of all words uppercase) for class name:   e.g. MyClass, My_Class
  • Most pre-defined function names can be used as value identifiers, but it should be avoided to keep away from confusion. For. eg. input can be used as an identifier, but it should be avoided.
  • Identifier rules of python keep getting updated as its new versions are released. It does support identifier names in other languages other than english with the help of unicode support. 
  • Identifier naming convention of python can be referred at PEP8 Style Guide.


Share

Created: 11-Apr-2026 19:39 | Updated: 18-Sep-2026 00:26|