Python Programming - Standard Libraries

Exercise : Standard Libraries - General Questions
  • Standard Libraries - General Questions
46.
Which module in Python is used for working with data compression and decompression, including formats like zlib and gzip?
compresslib
zlib
zip
gzip
Answer: Option
Explanation:
The gzip module in Python is used for working with gzip-compressed files.

47.
What does the itertools.chain() function do?
Chains two or more iterables into a single iterable
Generates all possible permutations of an iterable
Repeats an iterable indefinitely
Filters elements based on a predicate function
Answer: Option
Explanation:
The itertools.chain() function in Python chains two or more iterables into a single iterable.

48.
Which module in Python provides functions for working with regular expressions?
regex
relib
regexlib
re
Answer: Option
Explanation:
The re module in Python provides functions for working with regular expressions.

49.
What does the timeit module in Python provide?
Timing the execution of code snippets
Working with dates and times
Handling compressed files
Synchronous I/O operations
Answer: Option
Explanation:
The timeit module in Python provides a simple way to measure the execution time of small code snippets.

50.
Which module in Python is used for working with mathematical functions, including trigonometry and logarithms?
mathlib
cmath
trigmath
math
Answer: Option
Explanation:
The math module in Python provides mathematical functions, including trigonometry and logarithms.