Page 88 - TP_V5.1_C7_fb
P. 88

KEYWORDS
                  Keywords are the reserved words. They are predefined words. Keywords cannot be used as an
                  identifier.

                  Some commonly used keywords in Python are given below:

                    False     del        for        in         or         while     None       break         elif

                    from      is         with       True       else       global    and        continue      if
                    return    as         def        finally    import     not


                  CONSTANTS OR LITERALS

                  Constants are fixed values that do not change during the execution of a program. Literals are the
                  type of constant. Literals refer to any number, text and other information that represents a value.
                  Python supports the following literals:



                                                Literals                    Example




                                         String literals          “hello”, ‘12345’

                                         Integer literals         0, 1, 2, -1, -2

                                         Long literals            89675L

                                         Floating-point literals  3.14

                                         Complex literals         12j


                                         Boolean literals         True or False

                                         Special literals         None

                                         Unicode literals         u“hello”
                                         List literals            [5,6,7]





                       Tick ( ) if you know this.

                       ▶   Identifiers refers to the  name of a variable, function, array, etc.
                       ▶  A token is the smallest element of a Python program that is meaningful to the interpreter.


                  OPERATORS

                  Operators are special symbols that are used to perform some specific operations on operands and
                  give a meaningful result. Operands are the variables or constants involved in the mathematical
                  or logical operations.



                   86   Premium Edition-VII
   83   84   85   86   87   88   89   90   91   92   93