Python Programming - Standard Libraries

Exercise : Standard Libraries - General Questions
  • Standard Libraries - General Questions
26.
What does the statistics.median() function do?
Calculates the mean of a list of numbers
Finds the mode of a list of numbers
Calculates the median of a list of numbers
Computes the standard deviation of a list of numbers
Answer: Option
Explanation:
The statistics.median() function in Python is used to calculate the median of a list of numbers.

27.
Which module in Python provides support for working with XML, including parsing and creating XML documents?
xml
xmlparse
xmllib
xml.etree.ElementTree
Answer: Option
Explanation:
The xml.etree.ElementTree module in Python provides support for working with XML, including parsing and creating XML documents.

28.
Which module in Python is used for working with compressed archives, such as tar files?
zip
archivelib
tarlib
tarfile
Answer: Option
Explanation:
The tarfile module in Python provides functionality for working with tar archives.

29.
What is the purpose of the asyncio module?
Asynchronous I/O operations
Synchronous I/O operations
Mathematical operations
File I/O operations
Answer: Option
Explanation:
The asyncio module in Python provides support for writing asynchronous code, particularly for asynchronous I/O operations.

30.
Which method is used to convert a string to a lowercase version?
str.lowercase()
str.lower()
str.to_lower()
str.casefold()
Answer: Option
Explanation:
The lower() method is used to convert a string to its lowercase version in Python.