Python Programming - Standard Libraries
Exercise : Standard Libraries - General Questions
- Standard Libraries - General Questions
11.
Which module in Python is commonly used for working with regular expressions but has a simpler API compared to
re?
Answer: Option
Explanation:
The
regex module in Python provides a simpler API for working with regular expressions, offering additional features and improvements over the standard re module.
12.
Which function is used to retrieve the keys of a dictionary?
Answer: Option
Explanation:
The
keys() method is used to retrieve the keys of a dictionary in Python.
13.
What is the purpose of the
collections module?
Answer: Option
Explanation:
The
collections module in Python provides specialized data types and functions to work with collections, such as namedtuple, Counter, and defaultdict.
14.
Which module in Python is used for working with the operating system, providing a way to execute shell commands?
Answer: Option
Explanation:
The
os module in Python provides a way to interact with the operating system, including functions to execute shell commands.
15.
What is the purpose of the
hashlib module?
Answer: Option
Explanation:
The
hashlib module in Python is used for working with cryptographic hash functions, providing a way to generate secure hash values.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers