Exercise: Standard Libraries

Questions for: Standard Libraries

Which module in Python is used for working with binary data and provides methods for packing and unpacking binary data structures?
A:
binstruct
B:
structlib
C:
binary
D:
struct
Answer: D
The struct module in Python provides methods for packing and unpacking binary data structures.
What does the calendar module in Python provide?
A:
Handling compressed files
B:
Mathematical operations
C:
Working with dates and times
D:
Manipulating calendar data
Answer: D
The calendar module in Python provides functionality for manipulating calendar-related data, such as determining leap years and generating month calendars.
What is the purpose of the logging module?
A:
Handling dates and times
B:
Working with regular expressions
C:
Generating random numbers
D:
Logging messages to various outputs
Answer: D
The logging module in Python provides a flexible framework for emitting log messages from Python programs.
What is the purpose of the unicodedata module?
A:
Working with regular expressions
B:
Handling compressed files
C:
Manipulating Unicode character data
D:
Parsing JSON data
Answer: C
The unicodedata module in Python provides access to the Unicode Character Database, allowing manipulation of Unicode character data.
Which module in Python is used for working with mathematical functions, including trigonometry and logarithms?
A:
mathlib
B:
cmath
C:
trigmath
D:
math
Answer: D
The math module in Python provides mathematical functions, including trigonometry and logarithms.
Ad Slot (Above Pagination)
Quiz