Home
Locate
CS 101
CS 496
Login
Tutors
Marks
About
Send
Close
Add comments:
(status displays here)
Got it!
This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.
nbsp; Note: This appears on each machine/browser from which this site is accessed.
Python version
by RS
admin@ycp.powersoftwo.org
c
go
java
js
lua
py
vbs
rkt
scm
pro
1. Python version
The
sys
library can be used to get the version of Python under which the program is being run. Here is the Python code.
import sys # get version tuple (major1,minor1,micro1,release1,serial1) = sys.version_info print("Python:") print("\tMajor: {0:d}".format(major1)) print("\tMinor: {0:d}".format(minor1)) print("\tMicro: {0:d}".format(micro1)) print("\tRelease: {0:s}".format(release1)) print("\tSerial: {0:d}".format(serial1))
Here is the output of the Python code.
Python: Major: 3 Minor: 8 Micro: 0 Release: final Serial: 0
Note that the results depend on the installed version of Python used to run the program.
2. End of page
by RS
admin@ycp.powersoftwo.org