Python Programming - Standard Libraries

Exercise : Standard Libraries - General Questions
  • Standard Libraries - General Questions
31.
What is the purpose of the hashlib.pbkdf2_hmac() function?
Generating random numbers
Working with cryptographic hash functions
Parsing XML documents
Sorting elements in a list
Answer: Option
Explanation:
The hashlib.pbkdf2_hmac() function in Python is used for password-based key derivation using a cryptographic hash function.

32.
Which module in Python is used for parsing and creating JSON data?
jsonparse
jsonlib
jsondata
json
Answer: Option
Explanation:
The json module in Python provides functionality for parsing and creating JSON data.

33.
What is the purpose of the itertools.product() function?
Generates all possible permutations of an iterable
Computes the Cartesian product of multiple iterables
Repeats an iterable indefinitely
Filters elements based on a predicate function
Answer: Option
Explanation:
The itertools.product() function in Python computes the Cartesian product of multiple iterables.

34.
What does the array module in Python provide?
Support for working with arrays
Mathematical operations
File I/O operations
Regular expressions
Answer: Option
Explanation:
The array module in Python provides support for working with arrays, offering a more efficient alternative to lists for certain scenarios.

35.
What is the purpose of the tempfile module?
Mathematical operations
Working with temporary files and directories
Handling dates and times
Parsing JSON data
Answer: Option
Explanation:
The tempfile module in Python provides functionality for creating and handling temporary files and directories.