Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 100 - 2615_KEC
P. 100

    OPERATORS
                      Operators are special symbols that are used to perform 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.
                      Combination of variables, constants and operators makes an expression.

                                                Operator             Operator

                      Expression:       a           +          5         =          20

                                     Variable              Constant

                      PUNCTUATORS
                      Punctuators are also called separators as they are used to separate lines of codes, variables, etc.
                      The following characters are used as punctuators in Python: ` # \ () [] {} @ , : . ‘ =

                         Brackets []   indicate list.
                         Parentheses ()   indicate tuples, function calls, function parameters for grouping expressions etc.

                         Comma (,)   is used as a separator in a function argument list or variable declaration.
                         Colon (:)   indicates a labelled statement or conditional operator symbol.

                         Equal sign (=)   is used to initialise the value of variable.

                                DATA TYPES

                      Data types are used to define the type of value a data can contain. Each variable in Python is associated
                      with some data type. Each data type requires a different amount of memory and has some specific
                      operations performed on it.

                      Data types are divided into two categories as shown below:

                                                                          Data Types

                                          Numbers           Sets         Mapping         Sequence        Boolean

                               Integer/long            Float                      String            Lists

                                           Complex                     Dictionary          Tuple

                       98   Premium Edition-VII

| 95 96 97 98 99 100 101 102 103 104 105 |