set1
set1
a) 10,20,30
b) 10 20 30
c) 102030
d) none
a. _val
b. val
c. try
d. _try_
11. Which one of the following has the same precedence level?
a. Division, Power, Multiplication, Addition and Subtraction
b. Division and Multiplication
c. Subtraction and Division
d. Power and Division
a. 1,67,77,216
b. 4
c. 96
d. None
a. 2
b. 4
c. 0
d. 6
e. True
f. False
a. error
b. 2 1
c. 0 3 1
d. None of these
a. -4
b. 2
c. False
d. None of the above
a) Error
b) 6
c) 4
d) 3
a. ABCD
b. AB
c. BC
d. None of these
a. 4 2 1
b. 4 3 2 1
c. 4 2
d. None of these
def func(x):
x[0] = ['def']
x[1] = ['abc']
return id(x)
q = ['abc', 'def', 'xyz']
print(id(q) == func(q))
a) Error
b) None
c) False
d) True
a) Abc. def
b) abc. def
c) Abc. Def
d) ABC. DEF
26. Which of the following statements is used to create an empty set in Python?
a) ( )
b) [ ]
c) { }
d) set()
a) [1, 3, 5, 7, 8]
b) [1, 7, 8]
c) [1, 2, 4, 7, 8]
d) error
29. Which of the following Python statements will result in the output: 6?
A = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
a) A[2][1]
b) A[1][2]
c) A[3][2]
d) A[2][3]
a) error
b) 0 1 2 0
c) 0 1 2
d) none of the mentioned
Answer Key
1 – d,
2 -b,
3 – a,
4-d,
5–c,
6 – b [Explanation: Variable names should not start with a number.] ,
7 – a [Explanation: indicates private variables of a class, not be accessed from outside
the class.]
8 – b [Explanation : no restriction in the length of variables]
9 – c [Explanation : try is a keyword]
10 – a [ Explanation : follow : PEMDAS]
11- b
12 - b
13 – b [Exp: pow(x,y,z)= (x**y) % z]
14 – f [Exp: The all () function returns True if all items in an iterable are true, otherwise it
returns False.]
15. None of these [Exp : 1234]
16 - a
17 - False [Exp. “False” is considered as value zero]
18 – d
19 – 6 [The function len() returns the length of the number of elements in the iterable.
Therefore the output of the function shown above is 6.]
20 – c
21 – c
22 – d
23 – c
24 – b
25 – a [Explanation: The first letter of the string is converted to uppercase and the others
are converted to lowercase]
26 – d
27 - a [Exp: in 1st extend the elements present in list1 , not in list 2 and 3 i.e., 1,3 in 2 nd
extend the elements present in list 2 but not in list 1 and 3 i.e., 5 and similarly in last
extends the elements present in list 3 but not in list 1 and 2 i.e., 7 and 8, therefore all
together : [1, 3, 5, 7, 8]]
28 – c
29 – b
30 – c