Question 1 of 25
Hints left: 3
Q1
What will be the output of the following Python code? x = ['ab', 'cd'] print(list(map(upper, x)))
Q2
What is the purpose of the assert statement in Python?
Q3
What is a variable defined inside a function referred to as?
Q4
What will be the output of the following Python code? x = [12, 34] print(len(list(map(int, x))))
Q5
What will be the output of the following Python code? def foo(k): k = [1] q = [0] foo(q) print(q)
Q6
What will be the output of the following Python code? lamb = lambda x: x ** 3 print(lamb(5))
Q7
What will be the output of the following Python code? def f(x, y, z): return x + y + z f(2, 30, 400)
Q8
What will be the output of the following Python code? x = 50 def func(): global x print('x is', x) x = 2 print('Changed global x to', x) func() print('Value of x is', x)
Q9
What is the base case in the Merge Sort algorithm when it is solved recursively?
Q10
What will be the output of the following Python code? x=100 def f1(): global x x=90 def f2(): global x x=80 print(x)
Q11
What will be the output of the following Python code? x = [[0], [1]] print((' '.join(list(map(str, x))),))
Q12
The output of the following codes are the same. [x**2 for x in range(10)] list(map((lambda x:x**2), range(10)))
Q13
What will be the output of the following Python code? x = [[0], [1]] print((' '.join(list(map(str, x)))))
Q14
How many keyword arguments can be passed to a function in a single function call?
Q15
How can you define a function that accepts both positional and keyword arguments?
Q16
Which keyword is used for function?
Q17
Only problems that are recursively defined can be solved using recursion.
Q18
What will be the output of the following Python code? x = ['ab', 'cd'] print(len(map(list, x)))
Q19
If a function doesn't have a return statement, which of the following does the function return?
Q20
What will be the output of the following Python code? x = [12.1, 34.0] print(len(' '.join(list(map(str, x)))))
Q21
What will be the output of the following Python code? x = 'abcd' print(list(map([], x)))
Q22
What is the output of the following code: square = lambda x: x**2 result = square(5) print(result)
Q23
What will be the output of the following Python code? def to_upper(k): k.upper() x = ['ab', 'cd'] print(list(map(to_upper, x)))
Q24
What will be the output of the following Python code? def foo(i, x=[]): x.append(x.append(i)) return x for i in range(3): y = foo(i) print(y)
-
A
-
B
-
C
-
D
Q25
. . . . . . . . returns a dictionary of the module namespace. . . . . . . . . returns a dictionary of the current namespace.