MCQOPTIONS
Saved Bookmarks
This section includes 477 Mcqs, each offering curated multiple-choice questions to sharpen your Computer Science Engineering (CSE) knowledge and support exam preparation. Choose a topic below to get started.
| 301. |
Which of the following functions does not necessarily accept only iterables as arguments? |
| A. | enumerate() |
| B. | all() |
| C. | chr() |
| D. | max() |
| Answer» D. max() | |
| 302. |
, 3])) |
| A. | error |
| B. | [(1, 2), (2, 3)] |
| C. | [(0, 2), (1, 3)] |
| D. | [(2, 3)] |
| Answer» D. [(2, 3)] | |
| 303. |
The function complex(‘2-3j’) is valid but the function complex(‘2 – 3j’) is invalid. |
| A. | true |
| B. | false |
| Answer» B. false | |
| 304. |
The function divmod(a,b), where both ‘a’ and ‘b’ are integers is evaluated as: |
| A. | (a%b, a//b) |
| B. | (a//b, a%b) |
| C. | (a//b, a*b) |
| D. | (a/b, a%b) |
| Answer» C. (a//b, a*b) | |
| 305. |
What is the output of the function complex()? |
| A. | 0j |
| B. | 0+0j |
| C. | error |
| Answer» B. 0+0j | |
| 306. |
+2j) |
| A. | error |
| B. | 1 |
| C. | 2j |
| D. | 1+2j |
| Answer» E. | |
| 307. |
,-4), 2,7) |
| A. | 2 |
| B. | false |
| C. | -3 |
| D. | -4 |
| Answer» C. -3 | |
| 308. |
,0,4.2) |
| A. | true |
| B. | false |
| C. | error |
| Answer» D. | |
| 309. |
576) |
| A. | 4.5 |
| B. | 5 |
| C. | 4 |
| D. | 4.6 |
| Answer» C. 4 | |
| 310. |
,4,6) sum([1,2,3]) |
| A. | error, 6 |
| B. | 12, error |
| C. | 12, 6 |
| D. | error, error |
| Answer» B. 12, error | |
| 311. |
>8, 4>2, 1>2]) |
| A. | error |
| B. | true |
| C. | |
| D. | 4>2 |
| Answer» C. | |
| 312. |
5676,2)? |
| A. | 4.5 |
| B. | 4.6 |
| C. | 4.57 |
| D. | 4.56 |
| Answer» D. 4.56 | |
| 313. |
,4,0,6]) |
| A. | error |
| B. | true |
| C. | false |
| Answer» D. | |
| 314. |
Which of the following functions is a built- in function in python? |
| A. | seed() |
| B. | sqrt() |
| C. | factorial() |
| D. | print() |
| Answer» E. | |
| 315. |
'.zfill(5)) |
| A. | 00+99 |
| B. | 00099 |
| C. | +0099 |
| D. | +++99 |
| Answer» D. +++99 | |
| 316. |
: 100})) |
| A. | bcde |
| B. | abcd |
| C. | error |
| D. | none of the mentioned |
| Answer» E. | |
| 317. |
'.swapcase()) |
| A. | |
| B. | ab12 |
| C. | ab!2 d) |
| Answer» D. | |
| 318. |
erdE a'.isprintable()) |
| A. | true |
| B. | false |
| C. | none |
| D. | error |
| Answer» B. false | |
| 319. |
'.replace('cd', '12')) |
| A. | ab12ef12 |
| B. | abcdef12 |
| C. | ab12efcd |
| D. | none of the mentioned |
| Answer» B. abcdef12 | |
| 320. |
1'.isnumeric()) |
| A. | true |
| B. | false |
| C. | none |
| D. | error |
| Answer» C. none | |
| 321. |
'.isnumeric()) |
| A. | true |
| B. | false |
| C. | none |
| D. | error |
| Answer» B. false | |
| 322. |
,'.islower()) |
| A. | true |
| B. | false |
| C. | none |
| D. | error |
| Answer» B. false | |
| 323. |
'.isalnum()) |
| A. | true |
| B. | false |
| C. | none |
| D. | error |
| Answer» B. false | |
| 324. |
xa'.isdigit()) |
| A. | true |
| B. | false |
| C. | none |
| D. | error |
| Answer» C. none | |
| 325. |
:.2%}'.format(1/3)) |
| A. | 0.33 |
| B. | 0.33% |
| C. | 33.33% |
| D. | 33% |
| Answer» D. 33% | |
| 326. |
:.2}'.format(1/3)) |
| A. | 0.333333 |
| B. | 0.33 |
| C. | 0.333333:.2 |
| D. | error |
| Answer» C. 0.333333:.2 | |
| 327. |
2223334')) |
| A. | 1,112,223,334 |
| B. | 111,222,333,4 |
| C. | 1112223334 |
| D. | error |
| Answer» E. | |
| 328. |
2223334)) |
| A. | 1,112,223,334 |
| B. | 111,222,333,4 |
| C. | 1112223334 |
| D. | error |
| Answer» B. 111,222,333,4 | |
| 329. |
, 10, 12)) |
| A. | the sum of 2 and 10 is 12 |
| B. | error |
| C. | the sum of 0 and 1 is 2 |
| D. | none of the mentioned |
| Answer» B. error | |
| 330. |
[0]} and {0[1]}".format(( 'foo', 'bin'))) |
| A. | hello foo and bin |
| B. | hello (‘foo’, ‘bin’) and (‘foo’, ‘bin’) |
| C. | error |
| D. | none of the mentioned |
| Answer» B. hello (‘foo’, ‘bin’) and (‘foo’, ‘bin’) | |
| 331. |
} and {1}".format(('foo', 'bin'))) |
| A. | hello foo and bin |
| B. | hello (‘foo’, ‘bin’) and (‘foo’, ‘bin’) |
| C. | error |
| D. | none of the mentioned |
| Answer» D. none of the mentioned | |
| 332. |
!r} and {0!s}".format('fo o', 'bin')) |
| A. | hello foo and foo |
| B. | hello ‘foo’ and foo |
| C. | hello foo and ‘bin’ |
| D. | error |
| Answer» C. hello foo and ‘bin’ | |
| 333. |
} and {name2}".format( 'foo', 'bin')) |
| A. | hello foo and bin |
| B. | hello {name1} and {name2} |
| C. | error |
| D. | hello and |
| Answer» D. hello and | |
| 334. |
} and {0}".format('bin', 'foo')) |
| A. | hello foo and bin |
| B. | hello bin and foo |
| C. | error |
| D. | none of the mentioned |
| Answer» B. hello bin and foo | |
| 335. |
} and {1}".format('foo', 'bin')) |
| A. | hello foo and bin |
| B. | hello {0} and {1} foo bin |
| C. | error |
| D. | hello 0 and 1 |
| Answer» B. hello {0} and {1} foo bin | |
| 336. |
} and {name2}".format( name1='foo', name2='bin')) |
| A. | hello foo and bin |
| B. | hello {name1} and {name2} |
| C. | error |
| D. | hello and |
| Answer» B. hello {name1} and {name2} | |
| 337. |
What is the default value of encoding in encode()? |
| A. | ascii |
| B. | qwerty |
| C. | utf-8 |
| D. | utf-16 |
| Answer» D. utf-16 | |
| 338. |
, '12')) |
| A. | 12abcdef12 |
| B. | abcdef1212 |
| C. | 1212abcdef |
| D. | error |
| Answer» E. | |
| 339. |
, 11)) |
| A. | 2 |
| B. | 0 |
| C. | 1 |
| D. | error |
| Answer» C. 1 | |
| 340. |
, '1')) |
| A. | 1abcdef |
| B. | abcdef1 |
| C. | abcdef |
| D. | error |
| Answer» B. abcdef1 | |
| 341. |
, 1)) |
| A. | 1abcdef |
| B. | abcdef1 |
| C. | abcdef |
| D. | error |
| Answer» E. | |
| 342. |
), '*', sep= '') |
| A. | * abcdef * |
| B. | * abcdef * |
| C. | *abcdef * |
| D. | * abcdef* |
| Answer» E. | |
| 343. |
What function do you use to read a string? |
| A. | input(“enter a stringâ€) |
| B. | eval(input(“enter a stringâ€)) |
| C. | enter(“enter a stringâ€) |
| D. | eval(enter(“enter a stringâ€)) |
| Answer» B. eval(input(“enter a stringâ€)) | |
| 344. |
print(id(s1) == id(s2)) |
| A. | true false |
| B. | true true |
| C. | false true |
| D. | false false |
| Answer» D. false false | |
| 345. |
Suppose i is 5 and j is 4, i + j is same as |
| A. | i.    add(j) |
| B. | i.    add    (j) |
| C. | i.    add(j) |
| D. | i.    add(j) |
| Answer» C. i.    add(j) | |
| 346. |
To check whether string s1 contains another string s2, use |
| A. | s1.    contains    (s2) |
| B. | s2 in s1 |
| C. | s1.contains(s2) |
| D. | si.in(s2) |
| Answer» B. s2 in s1 | |
| 347. |
If a class defines the     str    (self) method, for an object obj for the class, you can use which command to invoke the     str     method. |
| A. | obj.    str    () |
| B. | str(obj) |
| C. | print obj |
| D. | all of the mentioned |
| Answer» E. | |
| 348. |
To return the length of string s what command do we execute? |
| A. | s.    len    () |
| B. | len(s) |
| C. | size(s) |
| D. | s.size() |
| Answer» B. len(s) | |
| 349. |
To retrieve the character at index 3 from string s=â€Hello†what command do we execute (multiple answers allowed)? |
| A. | s[] |
| B. | s.getitem(3) |
| C. | s.    getitem    (3) |
| D. | s.getitem(3) |
| Answer» D. s.getitem(3) | |
| 350. |
What is “Helloâ€.replace(“lâ€, “eâ€)? |
| A. | heeeo |
| B. | heelo |
| C. | heleo |
| D. | none |
| Answer» B. heelo | |