Explore topic-wise MCQs in Python.

This section includes 5 Mcqs, each offering curated multiple-choice questions to sharpen your Python knowledge and support exam preparation. Choose a topic below to get started.

1.

Suppose x is 345.3546, what is format(x, 10.3f ) (_ indicates space).

A. __345.355
B. ___345.355
C. ____345.355
D. _____345.354
Answer» C. ____345.355
2.

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)
3.

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
4.

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)
5.

What is Hello .replace( l , e )?

A. Heeeo
B. Heelo
C. Heleo
D. None
Answer» B. Heelo