Page 156 - trackpad v5.1 class 7 flipbook
P. 156

Output

                    Enter the Length 10
                    Enter the Width 4
                    Area of the Rectangle is :  40








                                    Imagine, comments in Python are secret messages from a wise mentor. What advice or tips
                                    would you leave in your code for future programmers to discover?






                         Hashtag


                       #Operator: An operator is a symbol that triggers a computation action
                       #Keywords: Keywords are the reserved words which are used for some specific purposes





                        REVISIT



                    ▶  A token is the smallest element of a Python program that is meaningful to the interpreter.
                    ▶  Identifiers are the names given to variables, functions and arrays.
                    ▶  Keywords are reserved words that are used for some specific purposes.
                    ▶  Constants or literals are the fixed values that do not change during the execution of a program.
                    ▶  An operator is a symbol that triggers a computation action.
                    ▶  Data types are used to define the type of data.











                  1.  Tick ( ) the correct option.

                     a.  Which of the following is a valid identifier in Python?
                         (i)  1var                                    (ii)  var_1
                        (iii)  Var^2                                 (iv)  Var 1

                     b.  Which logical operator is used when both logical conditions are true?
                         (i)  and                                     (ii)  not

                        (iii)  or                                    (iv)  None of these



                  154   Pro (V5.1)-VII
   151   152   153   154   155   156   157   158   159   160   161