Page 111 - Information_Practice_Fliipbook_Class11
P. 111
14. Write a program to accept a string (str) and a number, n. The program should display the string n number of times.
15. Differentiate between logical errors and runtime errors.
16. What is the value of the expression 150 / 5?
17. What is the value of the expression 90 // 4?
18. Is 'None' the same as None? Justify your answer.
19. What value will the expression bool(False)yield?
20. What value will the expression bool(7) yield?
21. What will be the output produced on evaluating the following expressions?
(i) bool(0)
(ii) 22 % 5 is 20 % 5
(iii) 78 / 12.3 == 78 // 12.3
(iv) 78 // 12.3 == int(78 // 12.3)
(v) 56 % 5.0
22. What will be the output produced on the execution of the following code?
p = 3/4 + 2
q = int(3/4 + 2)
r = 5 + int(5 / 2)
s = 5 + 3.0 / 2
t = int(5 + 4 / 6.0)
print(p, q, r, s, t)
23. Why are logical errors hard to locate?
24. Write a program to accept the length, breadth, and height of a parallelogram and display its area and perimeter.
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): Python allows scientific notation to express floating point numbers.
Reasoning(R): 45E02 is equivalent to 45.00
2. Assertion(A): The first element of a list is at index 0.
Reasoning(R): A list is an ordered data type.
3. Assertion(A): A tuple is an immutable data type.
Reasoning(R): Once created, the values in a tuple cannot be changed using an assignment operator.
4. Assertion(A): = is an assignment operator.
Reasoning(R): An assignment operator assigns the value of the expression on the right-hand side of the operator to the
operand on the left-hand side of the operator.
5. Assertion(A): Implicit type conversion is also known as coercion.
Reasoning(R): When a data value is converted from one data type to another by the Python interpreter, it is called type
conversion.
Data Types and Operators 97

