In [1]:
import sys
In [2]:
print(sys.version)
In [3]:
print(type(sys.version))
In [4]:
print(sys.version_info)
In [5]:
print(type(sys.version_info))
In [6]:
print(sys.version_info[0])
In [7]:
print(sys.version_info.major)
In [8]:
if sys.version_info.major == 3:
print('Python3')
else:
print('Python2')