Explore topic-wise MCQs in Python.

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

1.

The output of the function len(sys.argv) is ____________

A. Error
B. 1
C. 0
D. Junk value
Answer» C. 0
2.

To obtain a list of all the functions defined under sys module, which of the following functions can be used?

A. print(sys)
B. print(dir.sys)
C. print(dir[sys])
D. print(dir(sys))
Answer» E.
3.

What will be the output of the following Python code, if the sys module has already been imported?

A. helloworld
B. hello world10
C. hello world11
D. errorView Answer
Answer» D. errorView Answer
4.

What will be the output of the following Python code, if the code is run on Windows operating system?

A. Error
B. Hello
C. No output
D. Junk valueView Answer
Answer» C. No output
5.

The output of the functions len(“abc”) and sys.getsizeof(“abc”) will be the same.

A. True
B. False
Answer» C.
6.

Which of the following functions is not defined under the sys module?

A. sys.platform
B. sys.path
C. sys.readline
D. sys.argv
Answer» D. sys.argv
7.

Which of the following functions can help us to find the version of python that we are currently working on?

A. sys.version
B. sys.version()
C. sys.version(0)
D. sys.version(1)
Answer» B. sys.version()
8.

India5$

A. India
B. ‘India\n’
C. ‘India’
Answer» D.
9.

The output of the functions len(“abc”) and sys.getsizeof(“abc”) will be the same. State whether true or false.$

A. True
B. False
Answer» C.