Standard Libraries Questions and Answers
Practice ModeShowing 10 of 25 questions
Q11
Which module is used for data compression and archiving in Python?
Answer: Option C
Explanation: The zipfile module provides tools to create, read, write, append, and list a ZIP file.
Q12
Which module provides a high-level interface for file and directory operations?
Answer: Option B
Explanation: The shutil module offers a number of high-level operations on files and collections of files, such as copying and removal.
Q13
Which module provides access to some variables used by the interpreter?
Answer: Option C
Explanation: The sys module provides access to command-line arguments, interpreter version, and other system-specific parameters.
Q14
Which module is used for logging in Python applications?
Answer: Option B
Explanation: The logging module provides a flexible framework for emitting log messages from Python programs.
Q15
Which module provides access to the command-line arguments passed to a Python script?
Answer: Option B
Explanation: The sys.argv list contains the command-line arguments passed to a Python script.
Q16
Which module is used for parsing command-line options and arguments?
Answer: Option B
Explanation: The argparse module makes it easy to write user-friendly command-line interfaces.
Q17
Which module provides a way to create temporary files and directories?
Answer: Option C
Explanation: The tempfile module generates temporary files and directories that are automatically cleaned up.
Q18
Which module is used for working with email messages and MIME processing?
Answer: Option C
Explanation: The email package provides classes and functions to create, parse, and modify email messages.
Q19
Which module provides a way to use the built-in HTTP server for development?
Answer: Option C
Explanation: The http.server module defines classes for implementing HTTP servers for web service development.
Q20
Which module provides access to the Unicode character database?
Answer: Option C
Explanation: The unicodedata module provides access to the Unicode Character Database which defines character properties.