0% found this document useful (0 votes)
21 views2 pages

CLASS TEST QP (Chapter 1 and 2)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views2 pages

CLASS TEST QP (Chapter 1 and 2)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Q1-Q8 are for one mark each.

Q1 and Q2 are assertion and reasoning-based questions. Select one of the


options (A)-(D)
A) Both A and R are true and R is correct explanation of A
B) Both A and R are true but R is not correct explanation of A
C) Only A is True but R is false
D) Only R is True and A is false

1. Assertion (A) : Following code will result into output :True


a=[10,20]
b=a[:]
print( a is b)
Reasoning (R): is operator is used for checking whether or not both the
operands is using same memory location

2. Assertion (A ) : AND operator is applicable on two operands and NOT is


applicable on one operand only
Reasoning (R): AND is binary operator and NOT is a unary operator

3. State True or False


"In Python, data type of a variable depends on its value"

4. Which of the following datatype in Python supports concatenation?


a) int b) float c) bool d) str

5. What will be output of the following code:


d1={1:2,3:4,5:6}
d2=d1.popitem()
print(d2)
a) {1:2} b) {5:6} c) (1,2) d) (5,6)

6. Consider the given expression:


(not True) and False or True
Which of the following is the correct value of the expression?
a) True b) False c) None d) NULL

7. Which of the following statement(s) would give an error during


execution?
S=["CBSE"] # Statement 1
S+="Delhi" # Statement 2
S[0]= '@' # Statement 3
S=S+"Thank you" # Statement 4
a) Statement 1 b) Statement 2 c) Statement 3 d) Statement 4
8. What will the following expression be evaluated to in Python?
15.0 // 4 * 5 / 3
a) 6.25 b) 5 c) 5.0 d) 0.25

9.
(a) Given is a Python string declaration: (1M)
myexam="Russia Ukrain"
Write the output of: print(myexam[-2:2:-2])
(b) Write the output of the code given below: (1M)
d1 = {"name": "Aman", "age": 26}
d2 = {27:'age','age':28}
d1.update(d2)
print(d1.values())

10.Predict the output of the Python code given below: (2M)


List1 = list("Examination")
List2 =List1[1:-1]
new_list = []
for i in List2:
j=List2.index(i)
if j%2==0:
List1.remove(i)
print(List1)

11. What will be the possible output from (i)-(iv) for following code? (2M)
import random
list1 = [2, 3, 4, 5, 6, 7, 9]
L = random.randint(1, 4)
U = random.randint(3, 5)
for K in range (L, U + 1):
print(list1 [K], end = “#”)
(i) 3#4#5# (ii) 5#6#7# (iii) 6#7#9# (iv) 2#3#4

12.Write a program to repeatedly ask the user to enter the state and capital,
where state is the key and capital is the value for the given dictionary.
display only those states where the capital ends with the letter ‘i’. (3M)

13.Write a program that enters a string and stores indices of all the vowels of
a given string in a list . (3M)
For example: If S is "Computer", then indexList should be [1,4,6]

You might also like