Chapter 8 - Data Handling - Solutions of Computer Science With Python by Sumita Arora For Class 11 CBSE & NCERT - KnowledgeBoat
Chapter 8 - Data Handling - Solutions of Computer Science With Python by Sumita Arora For Class 11 CBSE & NCERT - KnowledgeBoat
Home / Class 11 - Computer Science with Python Sumita Arora / Data Handling
Chapter 8
Data Handling
Class 11 - Computer Science with Python Sumita Arora
Ad removed. Details
Question 1
1. Numeric
2. None ✓
3. Mappings
4. list ✓
5. Sequence
6. set ✓
7. tuple ✓
8. dictionary ✓
Question 2
1. Integer ✓
2. Boolean ✓
3. complex ✓
4. floating point ✓
5. list
6. None
Question 3
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 1/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Question 4
1. identity( )
2. id( ) ✓
3. refnum( )
4. ref( )
Question 5
1. in
2. is ✓
3. id
4. ==
Question 6
1. id(x) == id(y) ✓
2. len(x) == len(y)
3. x == y
4. all of these
Question 7
1. String
2. Tuples
3. Set ✓
4. dictionary ✓
Question 8
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 2/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
1. integer
2. floating point ✓
3. complex
4. all of these
Question 9
1. 4
2. 4.0 ✓
3. 2.5
4. none of these
Question 10
1. 4 ✓
2. 4.0
3. 2.5
4. none of these
Question 11
1. True
2. False ✓
3. Only in Functions
4. Only in modules
Question 12
1. Warning
2. Error
3. None
4. No Error ✓
Question 13
1. mutability
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 3/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
2. static typing
3. dynamic typing ✓
4. immutability
Question 14
1. Yes
2. No ✓
3. Yes, if the values are < 100
4. Yes, if the values are > 100
Question 15
a = 8.6
b = 2
print ( a//b )
1. 4.3
2. 4.0 ✓
3. 4
4. compilation error
Question 16
1. Operands ✓
2. Expression
3. operators
4. Equation
Question 17
1. Operands
2. Expression ✓
3. operators
4. Equation
Question 18
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 4/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
x = 10.0
y = (x < 100.0) and x >= 10
1. 110
2. True ✓
3. False
4. Error.
Question 19
1. 0.000001 ✓
2. 'None' ✓
3. 0
4. [ ]
5. False
6. True ✓
7. 1 ✓
8. 33 ✓
9. None
10. 0.0
Question 20
import math
x = 100
print ( x > 0 and math.sqrt( x ) )
1. True
2. 1
3. 10
4. 10.0 ✓
Question 21
1. not
2. %
3. and ✓
4. +
5. **
Question 22
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 5/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
1. 28
2. 739
3. 829
4. 64 ✓
Question 23
1. x += 5
2. x *= 5 ✓
3. x = x ** 5
4. none of these
Question 24
1. 0
2. 1
3. 10 ✓
4. 1.0
Question 25
1. 5 ✓
2. 1
3. 10
4. 0
Question 26
1. 5
2. 1
3. 10 ✓
4. 0
Question 27
1. 5
2. 1
3. 10 ✓
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 6/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
4. 0
Question 28
1. 0
2. 1
3. 10 ✓
4. 1.0
Question 29
1. 'a' ✓
2. "
3. 1
4. 0
Question 30
1. 'a'
2. " ✓
3. 1
4. 0
Question 31
1. 'a' ✓
2. "
3. 'x'
4. 1
Question 32
1. 'a'
2. ''
3. 'x' ✓
4. 1
Question 33
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 7/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
1. 'a'
2. ''
3. 'None' ✓
4. 1
Question 34
1. 'a' ✓
2. ''
3. 'None'
4. 1
Question 35
1. false
2. False ✓
3. 'false'
4. 'False'
Question 36
1. false
2. False
3. 'false' ✓
4. 'False'
Fill in the Blanks
Question 1
Question 2
Question 3
Question 4
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 8/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Question 5
Question 6
Question 7
Question 8
Question 9
Question 10
Question 11
Question 12
Question 13
Question 14
Question 15
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 9/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Question 1
Question 2
Question 3
Question 4
Question 5
Question 6
Question 7
Question 8
Question 9
Question 10
Question 11
Search by lesson title
Chapter 1
None and 'None' are the same. CONTENTS
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 10/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
p
Data Representation
Question 12 True/False Questions
Chapter 7
None has the truth value as False. Type B: Application Based
Python Fundamentals Questions
Chapter 8
True Type C: Programming
Practice/Knowledge based
Data Handling Questions
Chapter 9
Flow of Control Question 13
Chapter 10
String Manipulation
'None' has the truth value as False.
Chapter 11
List Manipulation False
Chapter 12
Tuples
Chapter 13 Question 14
Dictionaries
Question 15
Question 16
Question 17
Question 18
Question 19
Question 20
Question 1
Answer
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 11/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Question 2
Answer
1. Integers (signed)
2. Booleans
Question 3
Answer
Question 4
Answer
Question 5
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 12/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Answer
Question 6
str1 = '''Hell
o'''
str2 = '''Hell\
o'''
print(len(str1) > len(str2))
Answer
True
Question 7
Answer
1. Lists
2. Dictionaries
3. Sets
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 13/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
1. Integers
2. Floating-Point numbers
3. Booleans
4. Strings
5. Tuples
Question 8
Answer
1. Type
2. Value
3. Id
a=4
Question 9
Answer
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 14/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Question 10
1. 20 and 20.0
2. 20 and int(20)
3. str(20) and str(20.0)
4. 'a' and "a"
Answer
Question 11
Answer
Question 12
Answer
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 15/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
An implicit type
An explicit type
conversion is
conversion is
automatically
user-defined
performed by the
conversion that
compiler when
forces an
differing data types
expression to be
are intermixed in an
of specific type.
expression.
Example: Example:
a, b = 5, 25.5 a, b = 5, 25.5
c=a+b c = int(a + b)
Question 13
Answer
>>> a = 'abc'
>>> b = input("Enter a string: ")
Enter a string: abc
>>> a == b
True
>>> a is b
False
Question 14
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 16/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
(a) str1[0]
(b) str1[1]
(c) str1[-5]
(d) str1[-4]
(e) str1[5]
Answer
(a) H
(b) e
(c) H
(d) e
Explanation
0 1 2 3 4
H
e
l
l
o
−5 −4 −3 −2 −1
Question 15
str1[2] = 'p'
Answer
Question 16
(a) type (6 + 3)
(d) type (6 / 3)
(e) type (6 // 3)
(f) type (6 % 3)
Answer
(a) type (6 + 3)
⇒ int + int
⇒ int
So the result is int.
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 17/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
(c) type (6 * 3)
⇒ int * int
⇒ int
So the result is int.
(d) type (6 / 3)
⇒ int / int
⇒ float
So the result is float.
(e) type (6 // 3)
⇒ int // int
⇒ int
So the result is int.
(f) type (6 % 3)
⇒ int % int
⇒ int
So the result is int.
Question 17
Answer
a=a+b
we can write
a += b.
Question 18
Answer
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 18/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Question 19
(a) b and c
(b) b or c
Answer
(a) b and c
⇒ False and True
⇒ False
(b) b or c
⇒ True or False
⇒ True
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 19/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
⇒ True or False
⇒ True
Question 20
(a) 1 < x
(b) x >= 4
(c) x == 3
(d) x == 3.0
(h) 4/2 == 2
Answer
(a) True
(b) False
(c) True
(d) True
(e) True
(f) False
(g) True
(h) True
(i) False
Question 21
1 2
(a) b h
3
Answer
1 / 3 * b * b * h
(b) πr 2 h
Answer
math.pi * r * r * h
1
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 20/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
1 2
(c) πr h
3
Answer
1 / 3 * math.pi * r * r * h
Answer
Answer
(x - h) ** 2 + (y - k) ** 2 == r ** 2
−b + b2 − 4ac
(f) x =
2a
Answer
(g) an × am = an+m
Answer
a ** n * a ** m == a ** (n + m)
Answer
(a ** n) ** m == a ** (n * m)
an
(i) = an−m
am
Answer
a ** n / a ** m == a ** (n - m)
1
(j) a−n =
an
Answer
a ** -n == 1 / a ** n
Question 22
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 21/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Answer
Question 23
len('a') + 2 or int('a')
Answer
Question 24
Answer
Question 25
(i) 22 / 17 = 37 / 47 + 88 /83
(ii) len('375')**2
Answer
(ii) len('375')**2
⇒ 3 ** 2 [∵ len('375') = 3]
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 22/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
⇒9 [∵ 3 * 3 = 9]
Question 26
Answer
Question 27
Answer
Answer
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 24/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
⇒ False or True
⇒ True
Question 29
(d) 2 * (2 * (len("01")))
Answer
(d) 2 * (2 * (len("01")))
⇒ 2 * (2 * 2)
⇒2*4
⇒8
Question 30
Answer
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 25/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
9 * 10 + 21 % 12
Question 31
Answer
Question 32
Answer
Question 33
Answer
name='hello'
name[0] = 'p'
a = [1, 2, 3, 4, 5]
a[0] = 10
Question 34
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 26/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Answer
secs = 2565
mins = 2565 // 60
Question 35
Answer
Question 36
Answer
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 27/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Question 37
Answer
Question 38
Answer
Example: Example:
x = false x*y=z
Question 39
Answer
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 28/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Logical errors
Syntax Errors are need to be found
caught by the and corrected by
compiler. people working on
the program.
Question 40
Answer
Question 1
Answer
Question 2
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 29/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Answer
Question 3
a, b, c = 2, 3, 6
d = a + b * c/b
print(d)
Answer
Question 4a
a = va = 3
b = va = 3
print (a, b)
Answer
3 3
Question 4b
a = 3
b = 3.0
print (a == b)
print (a is b)
Answer
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 30/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
True
False
Question 5a
a, b, c = 1, 1, 2
d = a + b
e = 1.0
f = 1.0
g = 2.0
h = e + f
print(c == d)
print(c is d)
print(g == h)
print(g is h)
Answer
Output
True
True
True
False
Explanation
Question 5b
a = 5 - 4 - 3
b = 3**2**3
print(a)
print(b)
Answer
Output
-2
6561
Explanation
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 31/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
a=5-4-3
⇒a=1-3
⇒ a = -2
b = 3**2**3
⇒ b = 3**8
⇒ b = 6561
Question 5c
a, b, c = 1, 1, 1
d = 0.3
e=a+b+c-d
f=a+b+c == d
print(e)
print(f)
Answer
Output
2.7
False
Explanation
e = a+b+c-d
⇒ e = 1+1+1-0.3
⇒ e = 3-0.3
⇒ e = 2.7
f = a + b + c == d
⇒ f = 1 + 1 + 1 == 0.3
⇒ f = 3 == 0.3
⇒ f = False
Question 6a
a = 12
b = 7.4
c = 1
a -= b
print(a, b)
a *= 2 + c
print(a)
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 32/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
b += a * c
print(b)
Answer
Output
4.6 7.4
13.799999999999999
21.2
Explanation
a -= b
⇒a=a-b
⇒ a = 12 - 7.4
⇒ a = 4.6
a *= 2 + c
⇒ a = 4.6 * (2 + c)
⇒ a = 4.6 * (2 + 1)
⇒ a = 4.6 * 3
⇒ a = 13.799999999999999
b += a * c
⇒ b = b + (a * c)
⇒ b = 7.4 + (13.799999999999999 * 1)
⇒ b = 7.4 + 13.799999999999999
⇒ b = 21.2
Question 6b
x, y = 4, 8
z = x/y*y
print(z)
Answer
Output
4.0
Explanation
z = x/y*y
⇒ z = 4/8*8
⇒ z = 0.5*8
⇒ z = 4.0
Question 7
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 33/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Answer
x, y = 4, 8
z = int(x/y)*y
print(z)
Question 8
Answer
Question 9
a = input()
b = int(input())
c = a + b
print(c)
Answer
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 34/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
a = int(input())
Question 10
Answer
Output
Explanation
Question 11
a, b = "5.0", "10.0"
x = float(a/b)
print(x)
Answer
a, b = 5.0, 10.0
x = float(a/b)
print(x)
Question 12
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 35/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Answer
Question 13
Answer
import math
a = float(input("Enter the length of the
b = float(input("Enter the length of the
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 36/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
h = math.sqrt(a * a + b * b)
print("The length of the hypotenuse is",
Question 14
(a) 2.0/4
(c) 4 % 15
(d) int("5")/float("3")
(e) float("6"/"2")
Answer
(a) No Error
(b) No Error
(c) No Error
(d) No Error
Question 15a
3 or 10/0
Answer
10/0 or 3
Question 15b
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 37/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
a, b = bool(0), bool(0.0)
c, d = str(0), str(0.0)
print (len(a), len(b))
print (len(c), len(d))
Answer
Question 16
Answer
Question 17
a = True
b = 0 < 5
print (a == b)
print (a is b)
c = str (a)
d = str (b)
print (c == d)
print (c is d)
e = input ("Enter :")
print (c == e)
print (c is e)
Answer
Output
True
True
True
True
Enter :True
True
False
Explanation
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 38/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Question 18a
name = "HariT"
print (name)
name[2] = 'R'
print (name)
Answer
Question 18b
a = bool (0)
b = bool (1)
print (a == false)
print (b == true)
Answer
Question 18c
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 39/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Answer
Question 18d
pi = 3.14
print (type (pi))
print (type ("3.14"))
print (type (float ("3.14")))
print (type (float("three point fourteen"
Answer
Question 18e
print ("Hello" + 2)
print ("Hello" + "2")
print ("Hello" * 2)
Answer
Question 18f
print ("Hello"/2)
print ("Hello" / 2)
Answer
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 40/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Question 19a
Answer
Output
True False
Explanation
1. x or (y and z)
⇒ True or (False and False)
⇒ True
2. (x or y) and z
⇒ (True or False) and False
⇒ True and False
⇒ False
Question 19b
x, y = '5', 2
z = x + y
print(z)
Answer
Question 19c
s = 'Sipo'
s1 = s + '2'
s2 = s * 2
print(s1)
print(s2)
Answer
Output
Sipo2
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 41/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
SipoSipo
Explanation
Question 19d
w, x, y, z = True , 4, -6, 2
result = -(x + z) < y or x ** z < 10
print(result)
Answer
Output
False
Explanation
Question 20
Answer
Question 21
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 42/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
import random
r = random.randrange(100, 999, 5)
print(r, end = ' ')
r = random.randrange(100, 999, 5)
print(r, end = ' ')
r = random.randrange(100, 999, 5)
print(r)
Answer
Question 22
import random
r = random.randint(10, 100) - 10
print(r, end = ' ')
r = random.randint(10, 100) - 10
print(r, end = ' ')
r = random.randint(10, 100) - 10
print(r)
(a) 12 45 22
(b) 100 80 84
(c) 101 12 43
(d) 100 12 10
Answer
Option (a) — 12 45 22
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 43/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Question 23
import random
r = random.random() * 10
print(r, end = ' ')
r = random. random() * 10
print(r, end = ' ')
r = random.random() * 10
print(r)
Answer
Question 24
import statistics as st
v = [7, 8, 8, 11, 7, 7]
m1 = st.mean(v)
m2 = st.mode(v)
m3 = st.median(v)
print(m1, m2, m3)
(a) 7 8 7.5
(b) 8 7 7
(c) 8 7 7.5
(c) 8.5 7 7.5
Answer
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 44/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Question 1
Solution
si = p * r * t / 100
Output
Question 2
Solution
Output
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 45/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Enter Saturday Temperature: 25
Average Temperature = 23.47142857142857
Question 3
Solution
import math
x = int(input("Enter x: "))
y = int(input("Enter y: "))
z = int(input("Enter z: "))
res = 4 * x ** 4 + 3 * y ** 3 + 9 * z + 6
Output
Enter x: 2
Enter y: 3
Enter z: 5
Result = 208.84955592153875
Question 4
Solution
mins = totalSecs // 60
secs = totalSecs % 60
Output
Question 5
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 46/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Solution
Output
Question 6
Solution
Output
Question 7
Solution
Output
Question 8
Solution
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 47/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
d1 = x % 10
x //= 10
d2 = x % 10
x //= 10
d3 = x % 10
y = d1 * 100 + d2 * 10 + d3
print("Reversed Number:", y)
Output
Question 9
Solution
n = (m - 1) * 30 + d
Output
Enter day: 3
Enter month: 2
Day of the year: 33
Question 10
Solution
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 48/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
d = y * 365
h = d * 24
m = h * 60
s = m * 60
Output
Question 11
Solution
Output
Question 12
Sample Run 1:
Random number between 0 and 5 (A) : 2
Random number between 0 and 5 (B) :5.
A to the power B = 32
Sample Run 2:
Random number between 0 and 5 (A) : 4
Random number between 0 and 5 (B) :3.
A to the power B = 64
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 49/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Sample Run 3:
Random number between 0 and 5 (A) : 1
Random number between 0 and 5 (B) :1.
A to the power B = 1
Solution
import random
a = random.randint(0, 5)
b = random.randint(0, 5)
c = a ** b
Output
Question 13
Solution
import random
import statistics
print("Generated Numbers:")
print(a, b, c, d, e, f)
seq = (a, b, c, d, e, f)
mean = statistics.mean(seq)
median = statistics.median(seq)
mode = statistics.mode(seq)
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 50/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Output
Question 14
Solution
import random
a = random.randrange(100, 999, 5)
b = random.randrange(100, 999, 5)
c = random.randrange(100, 999, 5)
print("Generated Numbers:", a, b, c)
Output
Question 15
Solution
import random
print("OTP:", otp);
Output
OTP: 553072
Question 16
Solution
import random
import statistics
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 51/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
a = random.random()
b = random.random()
c = random.random()
d = random.random()
e = random.random()
f = random.random()
print("Generated Numbers:")
print(a, b, c, d, e, f)
seq = (a, b, c, d, e, f)
mean = statistics.mean(seq)
median = statistics.median(seq)
mode = statistics.mode(seq)
Output
Generated Numbers:
0.47950245404109626 0.6908539320958872 0.
Mean = 0.40750081141464756
Median = 0.4282969337996551
Mode = 0.47950245404109626
Question 17
Solution
import math
c = math.sqrt(a ** 2 + b ** 2)
print("Hypotenuse =", c)
Output
Question 18
Solution
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 52/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
import math
r = math.sqrt(area / (4 * math.pi))
Output
Question 19
Solution
Output
Question 20
Radius = 8 cm
Height = 15 cm
Solution
import math
r = 8
h = 15
v = math.pi * r * r * h
Output
Question 21
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 53/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Solution
import math
Output
Enter side: 5
Area of triangle = 10.825317547305481
Question 22
Solution
import math
Output
Question 23
Solution
si = p * r * t / 100
amt = p + si
Output
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 54/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Enter time: 3
Amount Payable = 78926.07625
Question 24
Solution
amt = p * (1 + r / 100) ** t
Output
Question 25
Solution
a = int(input("Enter a: "))
b = int(input("Enter b: "))
res = a ** 3 + b ** 3 + 3 * a ** 2 * b +
Output
Enter a: 3
Enter b: 5
Result = 512
Prev Next
Python Fundamentals Flow of Control
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 55/56
9/27/23, 10:29 PM Chapter 8: Data Handling | Solutions of Computer Science with Python by Sumita Arora for Class 11 CBSE & NCERT | Kno…
Class - 6 Effective History & Civics Solutions Java Number Programs (ICSE Classes 9 / 10) Privacy Policy
Class - 6 APC Understanding Computers Solutions Java Number Programs (ISC Classes 11 / 12) Terms of Service
Class - 7 Concise Physics Selina Solutions Output Questions for Class 10 ICSE Computer Applications
Class - 7 Concise Chemistry Selina Solutions Algorithms & Flowcharts for ICSE Computers
Class - 7 Dalal Simplified Middle School Chemistry Solutions ICSE Class 8 Computers Differentiate Between the Following
Class - 7 Living Science Biology Ratna Sagar Solutions Class - 9 Sumita Arora Computer Code 165 Solutions
Class - 7 Around the World Geography Solutions Class - 10 Sumita Arora Computer Code 165 Solutions
Class - 7 Veena Bhargava Geography Solutions Class - 10 Kips Cyber Beans Computer Code 165 Solutions
Class - 7 Effective History & Civics Solutions Class - 11 CBSE Sumita Arora Python Solutions
Class - 7 APC Understanding Computers Solutions Class - 12 CBSE Sumita Arora Python Solutions
https://www.knowledgeboat.com/learn/sumita-arora-python-computer-science-class-11-cbse/solutions/Yg3OP/python-data-handling 56/56