Page 120 - Trackpad_V5_Book 6
P. 120

Example:

            Program: #printing a string

            print(“Hello TrackPad”)
            Output: Hello TrackPad

            Multiple-line Comment
            Python does not have a syntax for multiline comments. To add a multiple-line comment, you
            could insert a # for each line. Example:


            Program: #print three names
            print(“Roli”)
            print(“Proloy”)

            print(“Devansh”)
            Output: Roli Proloy Devansh
            However, the text written inside triple quotes (‘’’ or ‘’””) is also considered a comment. You can

            use the triple quotes to write multiline comments.



                                     Write 'T' for True and 'F' for false.

                                     1.  Variables are memory reference points where we store values.
                    uiz    Bee       2.  An Integer is a collection of one or more characters put in single

                                       or double-quotes.




                      OPERATORS IN PYTHON
                                                                                             20 + 10
            Operators  are the special  symbols that  are used  to  perform
            computations. The values which the operators use to get the output
            are called operands.                                                         Operand      Operator
                (+) Addition operator: It is an arithmetic operator which is used to perform addition. Arithmetic
              operators  perform arithmetic  operations  between  two  operands.  Some  more  arithmetic
              operators are:
                (–) Subtraction operator: It subtracts the right-hand operand from the left-hand operand.
                (*) Multiplication operator: It multiplies values on either side of the operator.
                (/) Division operator: It divides the left-hand operand by the right-hand operand.

                (%) Modulus operator: It divides the left-hand operand by the right-hand operand and returns the
              remainder.
                (**) Exponentiation operator: It performs exponential (power) calculation on operands.

                (//) Floor or Integer division operator: It divides and cuts the fractional part from the result.
            We will learn about more operators in the next class.




             118  Pro (Ver. 5.0)-VI
   115   116   117   118   119   120   121   122   123   124   125