NIELIT M3-R5 Python MCQ Questions

NIELIT M3-R5 Python MCQ Questions

271.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘abcdef12’.replace(‘cd’, ’12’))
A) ab12ef12 ✔️
B) abcdef12
C) ab12efcd
D) none of the mentioned

272.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘abef’.replace(‘cd’, ’12’))
A) abef ✔️
B) 12
C) error
D) None of the mentioned
Answer: a

273.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘abcefd’.replace(‘cd’, ’12’))
A) ab1ef2
B) abcefd ✔️
C) ab1efd
D) ab12ed2

274.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘xyyxyyxyxyxxy’.replace(‘xy’, ’12’, 0))
A) xyyxyyxyxyxxy ✔️
B) 12y12y1212x12
C) 12yxyyxyxyxxy
D) xyyxyyxyxyx12

275.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘xyyxyyxyxyxxy’.replace(‘xy’, ’12’, 100))
A) xyyxyyxyxyxxy
B) 12y12y1212x12 ✔️
C) None of the mentioned
D) error

276.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘abcdefcdghcd’.split(‘cd’))
A) [‘ab’, ‘ef’, ‘gh’]
B) [‘ab’, ‘ef’, ‘gh’, “] ✔️
C) (‘ab’, ‘ef’, ‘gh’)
D) (‘ab’, ‘ef’, ‘gh’, “)
Answer: b

277.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘abcdefcdghcd’.split(‘cd’, 0))
A) [‘abcdefcdghcd’] ✔️
B) ‘abcdefcdghcd’
C) error
D) None of the mentioned

278.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘abcdefcdghcd’.split(‘cd’, -1))
A) [‘ab’, ‘ef’, ‘gh’]
B) [‘ab’, ‘ef’, ‘gh’, “] ✔️
C) (‘ab’, ‘ef’, ‘gh’)
D) (‘ab’, ‘ef’, ‘gh’, “)

279.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘abcdefcdghcd’.split(‘cd’, 2))
A) [‘ab’, ‘ef’, ‘ghcd’] ✔️
B) [‘ab’, ‘efcdghcd’]
C) [‘abcdef’, ‘ghcd’]
D) none of the mentioned

280.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘ab\ncd\nef’.splitlines())
A) [‘ab’, ‘cd’, ‘ef’] ✔️
B) [‘ab\n’, ‘cd\n’, ‘ef\n’]
C) [‘ab\n’, ‘cd\n’, ‘ef’]
D) [‘ab’, ‘cd’, ‘ef\n’]

281.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘Ab!2’.swapcase())
A) AB!@
B) ab12
C) aB!2 ✔️
D) aB1@

282.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘ab cd ef’.title())
A) Ab cd ef
B) Ab cd eF
C) Ab Cd Ef ✔️
D) None of the mentioned

283.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘ab cd-ef’.title())
A) Ab cd-ef
B) Ab Cd-ef
C) Ab Cd-Ef ✔️
D) None of the mentioned

284.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘abcd’.translate(‘a’.maketrans(‘abc’, ‘bcd’)))
A) bcde
B) abcd
C) error
D) bcdd ✔️

285.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘abcd’.translate({97: 98, 98: 99, 99: 100}))
A) bcde
B) abcd
C) error
D) None of the mentioned ✔️

286.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘\t’.isspace())
A) True ✔️
B) False
C) None
D) Error

287.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘HelloWorld’.istitle())
A) True
B) False ✔️
C) None
D) Error

288.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘Hello World’.istitle())
A) True ✔️
B) False
C) None
D) Error

289.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
print(‘Hello!2@#World’.istitle())
A) True ✔️
B) False
C) None
D) error

290.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
print(‘1Rn@’.lower())
A) n
B) 1rn@ ✔️
C) rn
D) r

291.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
print(”’
\tfoo”’.lstrip())
A) \tfoo
B) foo ✔️
C) foo
D) None of the mentioned

292.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
print(‘xyyzxxyxyy’.lstrip(‘xyy’))
A) error
B) zxxyxyy ✔️
C) z
D) zxxy

293.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
print(‘xyxxyyzxxy’.lstrip(‘xyy’))
A) zxxy ✔️
B) xyxxyyzxxy
C) xyxzxxy
D) none of the mentioned

294.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
print(‘cba’.maketrans(‘abc’, ‘123’))

A) {97: 49, 98: 50, 99: 51} ✔️
B) {65: 49, 66: 50, 67: 51}
C) 321
D) 123

295.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
print(‘a’.maketrans(‘ABC’, ‘123’))
A) {97: 49, 98: 50, 99: 51}
B) {65: 49, 66: 50, 67: 51} ✔️
C) {97: 49}
D) 1

296.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
print(‘abcdef’.partition(‘cd’))
A) (‘ab’, ‘ef’)
B) (‘abef’)
C) (‘ab’, ‘cd’, ‘ef’) ✔️
D) 2

297.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
print(‘abcdefcdgh’.partition(‘cd’))
A) (‘ab’, ‘cd’, ‘ef’, ‘cd’, ‘gh’)
B) (‘ab’, ‘cd’, ‘efcdgh’) ✔️
C) (‘abcdef’, ‘cd’, ‘gh’)
D) error

298.What will be the output of the following Python code?
निम्नलिखित पायथन कोड का आउटपुट क्या होगा?
print(‘abcd’.partition(‘cd’))
A) (‘ab’, ‘cd’, “) ✔️
B) (‘ab’, ‘cd’)
C) error
D) None of the mentioned

299.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘cd’.partition(‘cd’))
A) (‘cd’)
B) (“)
C) (‘cd’, “, “)
D) (“, ‘cd’, “) ✔️

300.What will be the output of the following Python code snippet?
निम्नलिखित पायथन कोड स्निपेट का आउटपुट क्या होगा?
print(‘abef’.partition(‘cd’))
A) (‘abef’)
B) (‘abef’, ‘cd’, “)
C) (‘abef’, “, “) ✔️
D) error

Relate Link