How to check what version of python is running the code in Python

2 Answers

0 votes
import sys

print(sys.version)


'''
run:

3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:01:18) [MSC v.1900 32 bit (Intel)]

'''

 



answered Nov 10, 2018 by avibootz
0 votes
import sys

print(sys.version_info)


'''
run:

sys.version_info(major=3, minor=5, micro=2, releaselevel='final', serial=0)

'''

 



answered Nov 10, 2018 by avibootz

Related questions

1 answer 244 views
2 answers 134 views
2 answers 146 views
1 answer 259 views
1 answer 136 views
...