Certified Associate in Python Programming (PCAP-31-03) — Question 90
Which one of the platform module functions should be used to determine the Python version?
Answer options
- A. platform.python_version()
- B. platform.processor()
- C. platform.uname()
- D. platform.version()
Correct answer: A
Explanation
The function platform.python_version() is specifically designed to return the version of the Python interpreter that is currently in use. The other options, such as platform.processor(), platform.uname(), and platform.version(), provide information about the processor, system, and the version of the operating system, respectively, but do not specifically indicate the Python version.