Identifiers,constants in Python


Identifier
                 A name in the Python program is called an identifier. It can be a class name or function name or variable name. 

For example
                 identifier1=256
Here, identifier1 is the name given to the value 256

Rules to follow when defining an identifier
  • Alphabet symbols(either lower case or upper case or mixed) and underscore symbol(_).
  • digits(0 to 9) .
Yes, Python is a case-sensitive language
for example
Note
               Code is writing in Python2 if u want to write the same code you have to use parentheses() in print statements.


Constants
          Fixed values such as numbers and letters are called constants. Constants usually declared and assigned to a new file containing variables, functions, etc which is imported to the main file and constants are written in capital or block letters or underscore's.

Example
MIN_VALUE=7 


Thank you for taking the time to read my article.


  


 




No comments:

Post a Comment