NIELIT O Level M3-R5 Solved Paper 3

NIELIT O Level M3-R5 Solved Paper 3

61.What will be the output of the python code shown below for various styles of format specifies?
प्रारूप की विभिन्न शैलियों के लिए नीचे दिखाए गए पायथन कोड का आउटपुट क्या होगा?
x=1234
res=’integers:…%d…%-6d…%06d’ %(x, x, x)
res
A) ‘integers:…1234…1234 …001234’ 
B) ‘integers…1234…1234…123400’
C) ‘integers:… 1234…1234…001234’
D) ‘integers:…1234…1234…001234’

Answer is A)
‘integers:…1234…1234 …001234’

62.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
x=3.3456789
‘%f | %e | %g’ %(x, x, x)
A) Error
B) ‘3.3456789 | 3.3456789+00 | 3.345678’
C) ‘3.345678 | 3.345678e+0 | 3.345678’
D) ‘3.345679 | 3.345679e+00 | 3.34568’ 

Answer is D)
‘3.345679 | 3.345679e+00 | 3.34568’ 

63.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
x=3.3456789
‘%-6.2f | %05.2f | %+06.1f’ %(x, x, x)
A) ‘3.35 | 03.35 | +003.3’ 
B) ‘3.3456789 | 03.3456789 | +03.3456789’
C) Error
D) ‘3.34 | 03.34 | 03.34+’

Answer is A)
‘3.35 | 03.35 | +003.3’ 

64.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
x=3.3456789
‘%s’ %x, str(x)
A) Error
B) (‘3.3456789’, ‘3.3456789’) 
C) (3.3456789, 3.3456789)
D) (‘3.3456789’, 3.3456789)

Answer is B)
(‘3.3456789’, ‘3.3456789’)

65.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
‘%(qty)d more %(food)s’ %{‘qty’:1, ‘food’: ‘spam’}
A) Error
B) No output
C) ‘1 more foods’
D) ‘1 more spam’ 

Answer is D)
‘1 more spam’

66.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
a=’hello’
q=10
vars()

A) {‘a’ : ‘hello’, ‘q’ : 10, ……..plus built-in names set 
by Python….}
B) {……Built in names set by Python……}
C) {‘a’ : ‘hello’, ‘q’ : 10}
D) Error

Answer is A)
{‘a’ : ‘hello’, ‘q’ : 10, ……..plus built-in names set

67.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
s='{0}, {1}, and {2}’
s.format(‘hello’, ‘good’, ‘morning’)
A) ‘hello good and morning’
B) ‘hello, good, morning’
C) ‘hello, good, and morning’ 
D) Error

Answer is C)
‘hello, good, and morning’

68.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
s=’%s, %s & %s’
s%(‘mumbai’, ‘kolkata’, ‘delhi’)
A) mumbai kolkata & delhi
B) Error
C) No output
D) ‘mumbai, kolkata & delhi’ 

Answer is D)
‘mumbai, kolkata & delhi’

69.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
t = ‘%(A)s, %(B)s, %(C)s’
t % dict(a=’hello’, b=’world’, c=’universe’)
A) ‘hello, world, universe’ 
B) ‘hellos, worlds, universes’
C) Error
D) hellos, world, universe

Answer is A)
‘hello, world, universe’

70.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
‘{a}, {0}, {abc}’.format(10, a=2.5, abc=[1, 2])
A) Error
B) ‘2.5, 10, [1, 2]’ 
C) 2.5, 10, 1, 2
D) ’10, 2.5, [1, 2]’

Answer is B)
‘2.5, 10, [1, 2]’

71.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
‘{0:.2f}’.format(1.234)
A) ‘1’
B) ‘1.234’
C) ‘1.23’ 
D) ‘1.2’

Answer is C)
‘1.23’

72.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
‘%x %d’ %(255, 255)
A) ‘ff, 255’ 
B) ‘255, 255’
C) ’15f, 15f’
D) Error

Answer is A)
‘ff, 255’

73.The output of the two codes shown below is the same.
नीचे दिखाए गए दो कोड का आउटपुट समान है।
i. ‘{0:.2f}’.format(1/3.0)
ii. ‘%.2f’%(1/3.0)
A) True 
B) False

Answer is A)
True

74.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
l=list(‘HELLO’)
‘first={0[0]}, third={0[2]}’.format(l)
A) ‘first=H, third=L’ 
B) ‘first=0, third=2’
C) Error
D) ‘first=0, third=L’

Answer is A)
‘first=H, third=L’

75.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
l=list(‘HELLO’)
p=l[0], l[-1], l[1:3]
‘a={0}, b={1}, c={2}’.format(*p)
A) Error
B) “a=’H’, b=’O’, c=(E, L)”
C) “a=H, b=O, c=[‘E’, ‘L’]”
D) Junk value

Answer is C)
“a=H, b=O, c=[‘E’, ‘L’]”

76.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
class Truth:
pass
x=Truth()
bool(x)
A) pass
B) true 
C) false
D) error

Answer is B)
true

77.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
if (9 < 0) and (0 < -9):
print(“hello”)
elif (9 > 0) or False:
print(“good”)
else:
print(“bad”)
A) error
B) hello
C) good 
D) bad

Answer is C)
good

78.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
not(10<20) and not(10>30)
A) True
B) False 
C) Error
D) No output

Answer is B)
False

79.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
X=”hi”
print(“05d”%X)
A) 00000hi
B) 000hi
C) hi000
D) error 

Answer is D)
error

80.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
X=”gan-boundry”
print(“%56s”,X)
A) 56 blank spaces before gan-boundry 
B) 56 blank spaces before gan and boundry
C) 56 blank spaces after gan-boundry
D) no change

Answer is A)
56 blank spaces before gan-boundry

81.What will be the output of the following Python expression if x=456?
यदि x = 456 निम्न पायथन अभिव्यक्ति का आउटपुट क्या होगा?
print(“%-06d”%x)
A) 000456
B) 456000
C) 456 
D) error

Answer is C)
456

82.What will be the output of the following Python expression if X=345?
यदि X = 345 निम्नलिखित पायथन अभिव्यक्ति का आउटपुट क्या होगा?
print(“%06d”%X)
A) 345000
B) 000345 
C) 000000345
D) 345000000

Answer is A)
000345

83.Which of the following formatting options can be used in order to add ‘n’ blank spaces after a given string ‘S’?
किसी दिए गए स्ट्रिंग ‘S’ के बाद add n ‘रिक्त स्थान जोड़ने के लिए निम्नलिखित में से कौन सा स्वरूपण विकल्प इस्तेमाल किया जा सकता है?
A) print(“-ns”%S)
B) print(“-ns”%S)
C) print(“%ns”%S)
D) print(“%-ns”%S) 

Answer is D)
print(“%-ns”%S)

84.What will be the output of the following Python expression if X = -122?
यदि X = -122 निम्नलिखित पायथन अभिव्यक्ति का आउटपुट क्या होगा?
print(“-%06d”%x)
A) -000122
B) 000122
C) –00122 
D) -00122

Answer is C)
–00122

85.What will be the output of the following Python expression if the value of x is 34?
यदि x का मान 34 है तो निम्नलिखित पायथन अभिव्यक्ति का आउटपुट क्या होगा?
print(“%f”%x)
A) 34.00
B) 34.0000
C) 34.000000 
D) 34.00000000

Answer is C)
34.000000

86.What will be the output of the following Python expression if x=56.236?
यदि x = 56.236 पर निम्नलिखित पायथन अभिव्यक्ति का आउटपुट क्या होगा?
print(“%.2f”%x)
A) 56.00
B) 56.24 
C) 56.23
D) 0056.236

Answer is B)
56.24

87.What will be the output of the following Python expression if x=22.19?
यदि x = 22.19 निम्न पायथन अभिव्यक्ति का आउटपुट क्या होगा?
print(“%5.2f”%x)
A) 22.1900
B) 22.00000
C) 22.19 
D) 22.20

Answer is C)
22.19

88.The expression shown below results in an error.
एक त्रुटि में परिणाम नीचे दिखाया गया है।
print(“-%5d0”,989)
A) True
B) False 

Answer is B)
False

89.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
‘%d %s %g you’ %(1, ‘hello’, 4.0)
A) Error
B) 1 hello you 4.0
C) 1 hello 4 you 
D) 1 4 hello you

Answer is C)
1 hello 4 you

90.The output of which of the codes shown below will be: “There are 4 blue birds.”?
नीचे दिखाए गए कोडों में से कौन सा आउटपुट होगा: “4 नीले पक्षी हैं?”
A) ‘There are %g %d birds.’ %4 %blue
B) ‘There are %d %s birds.’ %(4, blue) 
C) ‘There are %s %d birds.’ %[4, blue]
D) ‘There are %d %s birds.’ 4, blue

Answer is B)
‘There are %d %s birds.’ %(4, blue)

 

Relate Link