Page 80 - Information_Practice_Fliipbook_Class11
P. 80

1.  Assertion(A):  Python considers user input as strings
              Reasoning(R):  An INPUT() is used to accept user input from the keyboard.
           2.  Assertion(A):  Comments make the program lengthier.
              Reasoning(R):  Comments are ignored by the Python interpreter during execution.
           3.  Assertion(A):  An operator specifies the operation to be performed on the given operands.
              Reasoning(R):  An operand may be a constant or a variable.
           4.  Assertion(A):  Evaluating the following expression:
                          max('Anshul', 'Mridula', 'Shekhar', 'Ashish')
                          will yield 'Shekhar'.
              Reasoning(R):  max() takes only numeric values as arguments.
           5.  Assertion(A):  Python allows the conversion of data from one data type to another.
              Reasoning(R):  int() is an example of a type conversion function.


               Case-based Questions


           1.  Zorawar likes to work with numbers. He has just started working in Python and wants to perform the following mathematical
              operations using a Python program. He wants to accept two numbers and display their sum,   difference,   product,   quotient,
              and remainder. Help him complete his task.
           2.  Anish is a very naughty boy. His friend, Shankar wrote a program to accept 5 numbers and display each one of them in a
              single line, separated by a '$' symbol. The program is as follows:
              num1 = int(input('Enter a number'))
              num2 = int(input('Enter a number'))
              num3 = int(input('Enter a number'))
              num4 = int(input('Enter a number'))
              num5 = int(input('Enter a number'))
              print(num1,   num2,   num3,   num4,   num5,   sep = '$')
              On execution, the program produced the correct output. But Anish edited the program and got the following output:

              10 20 30 40 50$
              Which statement did Anish edit?

           3.  Susan is studying geometry. She wants to create a program in Python to accept the radius and display the area and perimeter
              of a circle. Help her complete the task.
           4.  Hardik wants to accept the following details of his friends - name, class, age, and their favourite sport. Thereafter, he wants
              the program to display the entire data, each data item separated by two blank lines. Help him complete the task.







                                                       Answers

          Multiple Choice Questions
          1. (d)      2. (c)     3. (c)     4. (d)      5. (c)     6. (b)     7. (a)
          True or False
          1. (T)      2. (T)     3. (F)     4. (F)      5. (T)     6. (T)     7. (F)      8. (F)
          9. (T)      10. (F)
          Fill in the blanks
          1. token            2. Keywords         3. input()          4. Comments         5. Enter
          6. space            7. string


          66   Touchpad Informatics Practices-XI
   75   76   77   78   79   80   81   82   83   84   85