Page 136 - Trackpad_V1_Book 7_Flipbook
P. 136

Some commonly used keywords in Python are given below:


                    False       assert         del           for            in              or              while
                    None        break          elif          from           is              pass            with
                    True        class          else          global         lambda          raise           yield

                    and         continue       except        if             nonlocal        return          async
                    as          def            finally       import         not             try             await


                  CONSTANTS OR LITERALS

                  Constants are the 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 refer to variables, functions and arrays.
                       ▶   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 a specific operation on operands and
                  give a meaningful result. Operands are the data involved in the mathematical operation and may
                  be stored in variables and constants.




                  134   Trackpad (Version 1.0)-VII
   131   132   133   134   135   136   137   138   139   140   141