Standard Libraries Questions and Answers

Practice Mode
Showing 10 of 25 questions
Q11
Which module is used for data compression and archiving in Python?
  • A compress
  • B zip
  • C zipfile
  • D archive
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?
  • A fileops
  • B shutil
  • C files
  • D directory
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?
  • A interpreter
  • B system
  • C sys
  • D env
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?
  • A log
  • B logging
  • C logger
  • D debug
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?
  • A argparse
  • B sys
  • C argv
  • D cli
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?
  • A getopt
  • B argparse
  • C options
  • D cli
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?
  • A tmp
  • B temp
  • C tempfile
  • D temporary
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?
  • A smtp
  • B mail
  • C email
  • D mime
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?
  • A httpserver
  • B server
  • C http.server
  • D webserver
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?
  • A unicode
  • B charset
  • C unicodedata
  • D ucd
Answer: Option C
Explanation: The unicodedata module provides access to the Unicode Character Database which defines character properties.
Questions and Answers for Competitive Exams Various Entrance Test