Page 110 - TP_Play_V2.1_class6
P. 110

The result of the above program is:

                      Output

                   Enter the height of the cylinder: 5
                   Enter the radius of the cylinder: 2.5
                   The volume of the cylinder is: 98.21428571428571
                   Surface area is: 117.85714285714286




                     Recap


                          A computer language is the medium by which instructions are transmitted to the computer
                          to perform a specific task.
                          Python is a popular high-level programming language.
                          Interactive Mode is a command line shell which gives immediate result for each command.
                          The input() function takes the user’s input while a program executes.

                          The print() function prints or sends the output to the standard output device.
                          Variables  are  memory reference  points where  we  store  values which  can  be  accessed  or
                          changed later.
                          A data type specifies the type of value a variable can contain.
                          Comments enable us to understand the way a program works.
                          Operators can be defined as special symbols which perform arithmetic and logical computations.




                                                         Exercise



                  A.  Tick (✓) the correct option.

                     1.   What will be the output of the following expression?
                        22 % 3

                        a.  7                                            b.  1

                        c.  0                                            d.  4

                     2.  The statement using AND operator results true if ........................... .

                        a.  both operands are true                       b.  both operands are false
                        c.  either of the operands is true               d.  None of these

                     3.  Which one of the following has the highest precedence in a logical expression?

                        a.  Multiplication                               b.  Exponential

                        c.  Parentheses                                  d.  Subtraction






                  108       Play (Ver. 2.1)-VI
   105   106   107   108   109   110   111   112   113   114   115