Standard Libraries Questions and Answers
Practice ModeShowing 10 of 25 questions
Q1
Which module in Python is used for working with regular expressions?
Answer: Option B
Explanation: The re module provides regular expression matching operations similar to those found in Perl.
Q2
Which module provides access to mathematical functions like sqrt() and sin()?
Answer: Option B
Explanation: The math module provides mathematical functions and constants for advanced mathematical operations.
Q3
Which module is used for working with dates and times in Python?
Answer: Option C
Explanation: The datetime module supplies classes for manipulating dates and times in both simple and complex ways.
Q4
Which module provides a way to use operating system dependent functionality like file operations?
Answer: Option B
Explanation: The os module provides a portable way of using operating system dependent functionality like reading or writing to the file system.
Q5
Which module is used for generating random numbers in Python?
Answer: Option B
Explanation: The random module implements pseudo-random number generators for various distributions.
Q6
Which module provides system-specific parameters and functions in Python?
Answer: Option C
Explanation: The sys module provides access to some variables used or maintained by the interpreter and functions that interact strongly with the interpreter.
Q7
Which module is used for reading and writing CSV files in Python?
Answer: Option B
Explanation: The csv module implements classes to read and write tabular data in CSV format.
Q8
Which module provides support for JSON encoding and decoding?
Answer: Option B
Explanation: The json module provides methods to encode and decode data in JSON format.
Q9
Which module is used for working with SQLite databases in Python?
Answer: Option C
Explanation: The sqlite3 module provides a SQL interface compliant with the DB-API 2.0 specification for SQLite databases.
Q10
Which module provides an interface to the HTTP protocol for building web clients?
Answer: Option C
Explanation: The urllib.request module defines functions and classes which help in opening URLs (mostly HTTP) in a complex world.