Python Programming - Standard Libraries
Exercise : Standard Libraries - General Questions
- Standard Libraries - General Questions
91.
How can you use the
tempfile
module in Python to create a temporary file?
Answer: Option
Explanation:
import tempfile
# Example usage of tempfile module for creating a temporary file
with tempfile.TemporaryFile() as temp_file:
temp_file.write(b'This is a temporary file content.')
temp_file.seek(0)
content = temp_file.read()
print(content)
92.
What is the purpose of the
zlib
module?
Answer: Option
Explanation:
import zlib
# Example usage of zlib module for compressing and decompressing data
data = b'This is some data to be compressed.'
compressed_data = zlib.compress(data)
decompressed_data = zlib.decompress(compressed_data)
print(decompressed_data.decode('utf-8'))
93.
What is a micro web framework for Python that is widely used for building web applications?
Answer: Option
Explanation:
Flask is a micro web framework for Python used to develop web applications. It is lightweight and easy to use, making it a popular choice for small to medium-sized projects.
94.
Which Python library is commonly used for data manipulation and analysis, providing data structures for efficiently storing large datasets?
Answer: Option
Explanation:
Pandas is a library in Python for data manipulation and analysis. It provides data structures like DataFrame and Series, which are efficient for handling large datasets.
95.
Which Python library is widely used for numerical computing and working with arrays?
Answer: Option
Explanation:
Numpy is a powerful library for numerical computing in Python. It provides support for large, multi-dimensional arrays and matrices, along with mathematical functions to operate on these arrays.
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers