NIELIT O Level M3-R5 Solved Paper 4

NIELIT O Level M3-R5 Solved Paper 4

91.What will be the output of the following Python function?
निम्नलिखित पायथन फ़ंक्शन का आउटपुट क्या होगा?
def f(p, q):
return p%q
f(0, 2)
f(2, 0)

A) 0
    0
B) Zero Division Error
Zero Division Error
C) 0 ✔️
Zero Division Error
D) Zero Division Error
    0

92.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
def f(x):
def f1(a, B):
print(“hello”)
if b==0:
print(“NO”)
return
return f(a, B)
return f1
@f
def f(a, B):
return a%b
f(4,0)

A) hello ✔️
    NO
B) hello
Zero Division Error
C) NO
D) hello

93.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
def f(x):
def f1(*args, **kwargs):
print(“*”* 5)
x(*args, **kwargs)
print(“*”* 5)
return f1
def a(x):
def f1(*args, **kwargs):
print(“%”* 5)
x(*args, **kwargs)
print(“%”* 5)
return f1
@f
@a
def p(m):
print(m)
p(“hello”)

A) ***** ✔️
%%%%%
hello
%%%%%
*****
B) Error
C) *****%%%%%hello%%%%%*****
D) hello

94.The following python code can work with ____ parameters.
निम्नलिखित पायथन कोड ____ मापदंडों के साथ काम कर सकता है।
def f(x):
def f1(*args, **kwargs):
print(“Sanfoundry”)
return x(*args, **kwargs)
return f1

A) 2
B) 1
C) any number of ✔️
D) 0

95.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
def f(x):
def f1(*args, **kwargs):
print(“*”, 5)
x(*args, **kwargs)
print(“*”, 5)
return f1
@f
def p(m):
p(m)
print(“hello”)

A) *****
    hello
B) *****
    *****
hello
C) *****
D) hello ✔️

96.A function with parameters cannot be decorated.
मापदंडों के साथ एक समारोह सजाया नहीं जा सकता।
A) True
B) False ✔️

97.Identify the decorator in the snippet of code shown below.
नीचे दिखाए गए कोड के स्निपेट में डेकोरेटर को पहचानें।
def sf():
pass
sf = mk(sf)
@f
def sf():
return

A) @f
B) f
C) sf()
D) mk ✔️

98.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
class A:
@staticmethod
def a(x):
print(x)
A.a(100)

A) Error
B) Warning
C) 100 ✔️
D) No output

99.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
def d(f):
def n(*args):
return ‘$’ + str(f(*args))
return n
@d
def p(a, t):
return a + a*t
print(p(100,0))

A) 100
B) $100 ✔️
C) $0
D) 0

100.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
def c(f):
def inner(*args, **kargs):
inner.co += 1
return f(*args, **kargs)
inner.co = 0
return inner
@c
def fnc():
pass
if __name__ == ‘__main__’:
fnc()
fnc()
fnc()
print(fnc.co)

A) 4
B) 3 ✔️
C) 0
D) 1

102.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
x = [‘ab’, ‘cd’]
for i in x:
i.upper()
print(x)

A) [‘ab’, ‘cd’] ✔️
B) [‘AB’, ‘CD’]
C) [None, None]
D) None of the mentioned

103.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
x = [‘ab’, ‘cd’]
for i in x:
x.append(i.upper())
print(x)

A) [‘AB’, ‘CD’]
B) [‘ab’, ‘cd’’, ‘AB’, ‘CD’]
C) [‘ab’, ‘cd’]
D) None of the mentioned ✔️

104.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
i = 1
while True:
if i%3 == 0:
break
print(i)
i + = 1

A) 1 2
B) 1 2 3
C) error ✔️
D) None of the mentioned

104.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
i = 1
while True:
if i%0O7 == 0:
break
print(i)
i += 1

A) 1 2 3 4 5 6 ✔️
B) 1 2 3 4 5 6 7
C) error
D) None of the mentioned

105.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
i = 5
while True:
if i%0O11 == 0:
break
print(i)
i += 1

A) 5 6 7 8 9 10
B) 5 6 7 8 ✔️
C) 5 6
D) error

106.The formatting method {1:<10} represents the______ positional argument,____ justified in a 10 character wide field.
प्रारूपण विधि {1: <10} ______ स्थितिगत तर्क का प्रतिनिधित्व करती है, ____ एक 10 वर्ण चौड़ा क्षेत्र में उचित है।
A) first, right
B) second, left ✔️
C) first, left
D) second, right

107.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
hex(255), int(‘FF’, 16), 0xFF
A) [0xFF, 255, 16, 255]
B) (‘0xff’, 155, 16, 255)
C) Error
D) (‘0xff’, 255, 255) ✔️

108.The output of the two codes shown below is the same.
नीचे दिखाए गए दो कोड का आउटपुट समान है।
i. bin((2**16)-1)
ii. ‘{}’.format(bin((2**16)-1))
A) True ✔️
B) False

109.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
‘{a}{b}{a}’.format(a=’hello’, b=’world’)
A) ‘hello world’
B) ‘hello’ ‘world’ ‘hello’
C) ‘helloworldhello’ ✔️
D) ‘hello’ ‘hello’ ‘world’

110.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
D=dict(p=’san’, q=’foundry’)
‘{p}{q}’.format(**D)

A) Error
B) sanfoundry ✔️
C) san foundry
D) {‘san’, ‘foundry’}

111.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
‘The {} side {1} {2}’.format(‘bright’, ‘of’, ‘life’)
A) Error ✔️
B) ‘The bright side of life’
C) ‘The {bright} side {of} {life}’
D) No output

112.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
‘{0:f}, {1:2f}, {2:05.2f}’.format(1.23456, 1.23456,
1.23456)
A) Error
B) ‘1.234560, 1.22345, 1.23’
C) No output
D) ‘1.234560, 1.234560, 01.23’ ✔️

113.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
‘%.2f%s’ % (1.2345, 99)
A) ‘1.2345’, ’99’
B) ‘1.2399’ ✔️
C) ‘1.234599’
D) 1.23, 99

114.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
‘%s’ %((1.23,),)
A) ‘(1.23,)’ ✔️
B) 1.23,
C) (,1.23)
D) ‘1.23’

115.What will be the output of the following two codes?
निम्नलिखित दो कोडों का आउटपुट क्या होगा?
i. ‘{0}’.format(4.56)
ii. ‘{0}’.format([4.56,])
A) ‘4.56’, ‘4.56,’
B) ‘4.56’, ‘[4.56]’ ✔️
C) 4.56, [4.56,]
D) 4.56, [4.56,]

116.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
def mk(x):
def mk1():
print(“Decorated”)
x()
return mk1
def mk2():
print(“Ordinary”)
p = mk(mk2)
p()

A) Decorated
Decorated
B) Ordinary
Ordinary
C) Ordinary
Decorated
D) Decorated ✔️
Ordinary

117.In the following Python code, which function is the decorator?
निम्नलिखित पायथन कोड में, कौन सा फ़ंक्शन डेकोरेटर है?
def mk(x):
def mk1():
print(“Decorated”)
x()
return mk1
def mk2():
print(“Ordinary”)
p = mk(mk2)
p()

A) p()
B) mk()✔️
C) mk1()
D) mk2()

118.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.
डेकोरेटर फंक्शन के नाम के साथ-TheMymbol को फंक्शन की परिभाषा से ऊपर रखा जा सकता है, जिसे किसी फंक्शन को सजाने के वैकल्पिक तरीके के रूप में सजाया जा सकता है।
A) #
B) $
C) @ ✔️
D) &

119.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
def ordi():
print(“Ordinary”)
ordi
ordi()

A) Address ✔️
    Ordinary
B) Error
   Address
C) Ordinary
    Ordinary
D) Ordinary
     Address

120.The two snippets of the following Python codes are equivalent.
निम्नलिखित पायथन कोड के दो स्निपेट समतुल्य हैं।
CODE 1
@f
def f1():
print(“Hello”)
CODE 2
def f1():
print(“Hello”)
f1 = f(f1)
A) True ✔️
B) False

Relate Link