Question 1 of 25
Hints left: 3
Q1
What will be the output of the following Python code? e="butter" def f(a): print(a)+e f("bitter")
Q2
Where is function defined?
Q3
What will be the output of the following Python code? x = [12, 34] print(len(list(map(len, x))))
Q4
What is called when a function is defined inside a class?
Q5
What will be the output of the following Python code? def change(one, *two): print(type(two)) change(1,2,3,4)
Q6
What will be the output of the following Python code? elements = [0, 1, 2] def incr(x): return x+1 print(list(map(incr, elements)))
Q7
Which of the following numbers will not be a part of the output list of the following Python code? def sf(a): return a%3!=0 and a%5!=0 m=filter(sf, range(1, 31)) print(list(m))
Q8
Which is the most appropriate definition for recursion?
Q9
What will be the output of the following Python code? def foo(k): k[0] = 1 q = [0] foo(q) print(q)
Q10
What will be the output of the following Python code? x = [12, 34] print(len(' '.join(list(map(int, x)))))
Q11
What is the output of the following code: def my_function(a, b): return a * b result = my_function(4, 0) print(result)
Q12
What will be the output of the following Python code? x = [12, 34] print(len(''.join(list(map(str, x)))))
Q13
What will be the output of the following Python code? x = [12.1, 34.0] print(' '.join(list(map(str, x))))
Q14
What is a Python module?
Q15
What are the two main types of functions?
Q16
What is the output of the following code: def greet(name="User"): print(f"Hello, {name}!") greet()
Q17
What will be the output of the following Python code? def writer(): title = 'Sir' name = (lambda x:title + ' ' + x) return name who = writer() who('Arthur')
Q18
What will be the output of the following Python code? def to_upper(k): return k.upper() x = ['ab', 'cd'] print(list(map(to_upper, x)))
Q19
What will be the output of the following Python code? l1=[1, 2, 3, (4)] l2=l1.copy() l2 l1
-
A
-
B
-
C
-
D
Q20
What will be the output of the following Python code? x = 1234 print(list(map(list, [x])))
Q21
What will be the output of the following Python code? l=[2, 3, [4, 5]] l2=l.copy() l2[0]=88 l l2
-
A
-
B
-
C
-
D
Q22
What will be the output of the following Python code? def f(p, q, r): global s p = 10 q = 20 r = 30 s = 40 print(p,q,r,s) p,q,r,s = 1,2,3,4 f(5,10,15)
Q23
In . . . . . . . . copy, the base address of the objects are copied. In . . . . . . . . copy, the base address of the objects are not copied.
Q24
How can you use a module in Python?
Q25
What will be the output of the following Python code? x=1 def cg(): global x x=x+1 cg() x