Time Left : 00 : 30 : 00
In order to store values in terms of key and value we use what core data type
Correct Answer : D
What will be the output of the following Python code?
print("abc. DEF".capitalize())
Correct Answer : C
Which of the following is the same as math.exp(p)?
Correct Answer : B
The output of the following codes are the same.
[x**2 for x in range(10)] list(map((lambda x:x**2), range(10)))
Correct Answer : A
All modular designs are because of a top-down design process.
Correct Answer : B
The ______ symbol along with the name of the decorator function can be placed above the definition of the function to be decorated works as an alternate way for decorating a function.
Correct Answer : C
Which of the following is the use of id() function in python?
Correct Answer : A
Which of the following Python statements will result in the output: 6?
A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
Correct Answer : B
In top-down design every module is broken into same number of submodules.
Correct Answer : B
Mathematical operations can be performed on a string.
Correct Answer : B
What is the default value of encoding in encode()?
Correct Answer : C
What will be the output of the following Python code?
print('a B'.isalpha())
Correct Answer : B
What will be the output of the following Python code?
data = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]] def ttt(m): v = m[0][0] for row in m: for element in row: if v < element: v = element return v print(ttt(data[0]))
Correct Answer : C
Which of the following is the truncation division operator?
Correct Answer : C
What will be the output of the following Python code if a=10 and b =20?
a=10 b=20 a=a^b b=a^b a=a^b print(a,b)
Correct Answer : C
Which of the following data structures is returned by the functions globals() and locals()?
Correct Answer : C
What will be the value of ‘result’ in following Python program?
list1 = [1,2,3,4] list2 = [2,4,5,6] list3 = [2,6,7,8] result = list() result.extend(i for i in list1 if i not in (list2+list3) and i not in result) result.extend(i for i in list2 if i not in (list1+list3) and i not in result) result.extend(i for i in list3 if i not in (list1+list2) and i not in result)
Correct Answer : A
What will be the output of the following Python code snippet?
test = {1:'A', 2:'B', 3:'C'} del test[1] test[1] = 'D' del test[2] print(len(test))
Correct Answer : B
What will be the output of the following Python code?
def f1(x): global x x+=1 print(x) f1(15) print("hello")
Correct Answer : A
What will be the output of the following Python function?
{x for x in 'abc'} {x*3 for x in 'abc'}
Correct Answer : C
What will be the output of the following Python code?
def printMax(a, b): if a > b: print(a, 'is maximum') elif a == b: print(a, 'is equal to', b) else: print(b, 'is maximum') printMax(3, 4)
Correct Answer : C
What will be the output of the following Python code?
def change(i = 1, j = 2): i = i + j j = j + 1 print(i, j) change(j = 1, i = 2)
Correct Answer : D
What will be the output of the following Python code if the system date is 18th June, 2017 (Sunday)?
import datetime tday=datetime.date.today() print(tday)
Correct Answer : C
Which of the following is false about “from-import” form of import?
Correct Answer : B
What will be the output of the following Python code?
>>> import collections >>> a=collections.OrderedDict((str(x),x) for x in range(3)) >>> a
Correct Answer : B
What will be the output of the following Python code?
i = 0 while i < 5: print(i) i += 1 if i == 3: break else: print(0)
Correct Answer : B
What will be the output of the following Python code?
d = {0, 1, 2} for x in d: print(d.add(x))
Correct Answer : C
What will be the output of the following Python code snippet?
s=set([1, 2, 3]) s.union([4, 5]) s|([4, 5])
Correct Answer : C
Which of the following functions does not throw an error?
Correct Answer : B
What will be the output of the following Python code?
s='%s, %s & %s' s%('mumbai', 'kolkata', 'delhi')
Correct Answer : D