Q121
Open questionSelect an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
182
Questions
7/10
Page
Pick an option on a question to see the right answer and solution.
Q121
Open questionSelect an option to see the answer and solution.
Q122
Open questionSelect an option to see the answer and solution.
Q123
Open questionSelect an option to see the answer and solution.
Q124
Open questionl=[]
def convert(b):
if(b==0):
return l
dig=b%2
l.append(dig)
convert(b//2)
convert(6)
l.reverse()
for i in l:
print(i,end="")Select an option to see the answer and solution.
Q125
Open questionl=[n for n in range(5)]
f=lambda x:bool(x%2)
print(f(3), f(1))
for i in range(len(l)):
if f(l[i]):
del l[i]
print(i)Select an option to see the answer and solution.
Q126
Open questionl=[1, 2, 3, 4, 5]
def f1(x):
return x<0
m1=filter(f1, l)
print(list(m1))Select an option to see the answer and solution.
Q127
Open questiondef C2F(c):
return c * 9/5 + 32
print C2F(100)
print C2F(0)Select an option to see the answer and solution.
Q128
Open questiondef say(message, times = 1):
print(message * times)
say('Hello')
say('World', 5)Select an option to see the answer and solution.
Q129
Open questionf=lambda x:bool(x%2)
print(f(20), f(21))Select an option to see the answer and solution.
Q130
Open questionimport functools
l=[1, 2, 3, 4, 5]
m=functools.reduce(lambda x, y:x if x>y else y, l)
print(m)Select an option to see the answer and solution.
Q131
Open questiondef foo(i, x=[]):
x.append(i)
return x
for i in range(3):
print(foo(i))Select an option to see the answer and solution.
Q132
Open questionSelect an option to see the answer and solution.
Q133
Open questiondef f(x):
print("outer")
def f1(a):
print("inner")
print(a,x)
f(3)
f1(1)Select an option to see the answer and solution.
Q134
Open questiondef f1(a,b=[]):
b.append(a)
return b
print(f1(2,[3,4]))Select an option to see the answer and solution.
Q135
Open questionx = abcd
print(list(map(list, x)))Select an option to see the answer and solution.
Q136
Open questionSelect an option to see the answer and solution.
Q137
Open questionSelect an option to see the answer and solution.
Q138
Open questionSelect an option to see the answer and solution.
Q139
Open questiondef f1():
x=100
print(x)
x=+1
f1()Select an option to see the answer and solution.
Q140
Open questiondef power(x, n=2):
return x ** n
result = power(3)
print(result)Select an option to see the answer and solution.