Page 106 - Information_Practice_Fliipbook_Class11
P. 106
(ii) [1,4,"yes",90.6]
(iii) 2-8j
(iv) True
(v) None
Ans. (i) str
(ii) list
(iii) complex
(iv) bool
(v) None
2. Identify the real and imaginary part of the complex number, 4-8j.
Ans. real: 4.0
imaginary: -8.0
3. What is the difference between mutable and immutable objects?
Ans. An object that can be modified after it is created is called mutable, for example, objects of type list, and set.
An object that cannot be modified after it is created is called immutable, for example, objects of type int, float,
tuple, str.
4. Add a pair of parentheses to each of the following expressions so that it evaluates to True.
(i) 2 == 1 == 0
(ii) 5<4 == 4<3
Ans. (i) (2 == 1) == 0
(ii) (5<4) == (4<3)
5. Which function is used to get the data type of an object?
Ans. type()
6. Name three sequence types.
Ans. string, list, tuple
7. Using non-negative indexes, what is the index of the first element of a sequence?
Ans. 0
8. Consider the following string:
text = "Read the newspaper"
What will be the output of the statements given below:
(i) text[1]
(ii) text[6]
(iii) text[15]
Ans. (i) 'e'
(ii) 'h'
(iii) 'p'
9. What is the difference between unary and binary operators?
Ans. A unary operator takes one operand, while a binary operator takes two operands.
10. What will be the output when the following expressions are evaluated?
(i) 33 * 5/6 + 1
Ans. 28.5
(ii) 2 * (22//7) * 5
Ans. 30
92 Touchpad Informatics Practices-XI

