2 Dec 2020

Variables, keywords and identifiers

Variables :

         * A variable allows us to store a value by assigning it to a name, which can be used later.
         * Programmers generally choose names for their variables that are meaningful.
         * Named memory locations to store values.
          * We don't need to declare a variable before using it. 
           
           It can be of any length. No space is allowed.

Keywords :

          * Keywords are the reserved words in Python.
          * We cannot use a keyword as variable name, function name or any other
identifier.
          * They are used to define the syntax. 

  

Identifiers :

                    Identifier is the name given to entities  like class, functions, variables etc. in Python.
            
       * Identifiers can be a combination of letters in lowercase (a to z) or uppercase (A  to Z) or digits (0 to 9) or an underscore ( _ ). 

       * An identifier cannot start with a digit. 
     
       *Keywords can't be used as identifiers
 
        *Cannot use special symbols like !, @, #, $, % etc. in our identifier.

         *Identifier can be of any length.



No comments:

Post a Comment

Operator precedence

           When an expression contains more than one operator, the order of evaluation depends on the order of operations.            The ac...