Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+2 votes
3 views
in Python by (10.2k points)
How to check which Python version is interpreting my script?

3 Answers

0 votes
by (46k points)
edited by

Either use sys.hexversion or python- V:

>>> import sys
>>> sys.hexversion
221723736
>>> '%x' % sys.hexversion
'38908f2'
>>> sys.hexversion < 0X07236000
True


Or


 python -V

0 votes
by (106k points)

From the command line you can use the below command:-

python -V

You can use the following video tutorials to clear all your doubts:-

0 votes
by (20.3k points)

Try using this:

>>> import sys

>>> sys.hexversion

33883376

>>> '%x' % sys.hexversion

'20504f0'

>>> sys.hexversion < 0x02060000

True

For more information, you can refer to this: http://docs.python.org/library/sys.html#sys.hexversion

Related questions

0 votes
2 answers
asked May 30, 2019 in Python by Anvi (10.2k points)
+1 vote
1 answer
+1 vote
4 answers
+1 vote
2 answers
+3 votes
2 answers

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...