Page 107 - Information_Practice_Fliipbook_Class11
P. 107

(iii)  10 ** 2 - 45 / 6
             Ans.  92.5

                  (iv)  "SUN" + "MOON"
             Ans.  'SUNMOON'
                  (v)  45 % 3 > 8 and 23 // 6
             Ans.  False
                  (vi)  (90 - 3 // 5) > 5 or 2 ** 3 > 5
             Ans.  True

                  (vii)  not True or False and True
             Ans.  False

                  (viii) "TOWER" * 3
             Ans.  'TOWERTOWERTOWER'
              11.  Identify the errors in the given code:
                  radius = input("Enter a number")
                  area =  2 * 3.14 * Radius
                  PRINT("The area is " + area)
             Ans.  radius = int(input("Enter a number") )    ……….int() should be used
                  area =  2 * 3.14 * radius                       ……. Wrong variable name
                  print("The area is ", area)                     ……...wrong function name and usage
              12.  Write a program that takes the temperature in Celsius and displays it in Fahrenheit.
             Ans.  #Objective: Given temperature in degrees Celsius. Display in Fahrenheit.
                  celsius = int(input("Enter temperature in degree Celsius : "))
                  F = celsius * 9 / 5 + 32
                  print("The temperature in degree Fahrenheit is  : ", F)

                   Assertion and Reasoning Based Questions


               The following questions are assertion(A) and reasoning(R) based. Mark the correct choice as
               a.  Both A and R are true and R is the correct explanation of A
               b.  Both A and R are true and R is not the correct explanation of A
               c.  A is true but R is false
               d.  A is false but R is true
               1.  Assertion(A):  0x876 is a hexadecimal number
                  Reasoning(R):  The computer understands only hexadecimal number system.
               2.  Assertion(A):  90+3j is a complex number.
                  Reasoning(R):  A complex number is of the form x+yj in which x is called the real part, and y is called the imaginary part.
               3.  Assertion(A):  A boolean value may be True or False.
                  Reasoning(R):  Python considers the numeric value 0 as  False and a numeric value other than 0 as True.
               4.  Assertion (A):  Lists and tuples can store multiple data items.
                  Reasoning(R):  A list is mutable while a tuple is immutable.
               5.  Assertion(A):  Set is an unordered data type.
                  Reasoning(R):  A set cannot have duplicate values.
               6.  Assertion(A):  True and False will result in False.
                  Reasoning(R):  An and operator yields  True if both the operands are True, and False otherwise.



                                                                                        Data Types and Operators  93
   102   103   104   105   106   107   108   109   110   111   112