# To check your Python version in the command line use:
python --version
# To check your Python verson inside a script use:
import sys
print(sys.version)
python --version
# new way to know about python version in your windows pc,follow the steps below
step-1:Open CMD
step-2:write py --version
Congratulations!Now you know the version of python in your PC.
python3 --version # This is to check the python 3 version on mac terminal
#checking using cmd
python --version
#using python script to get version
import os
os.system("python --version")
PS C:UsersMyUsername> py -V
Python 3.9.0
# To check Python version
python -V
----or----
python --version
# 2 ways to check python version
# In the terminal/cmd write the following:
# Way 1
python -V
# Way 2
python -c "import sys; print(sys.version)"
python --versrion
print(sys.version_info)
# sys.version_info(major=3, minor=8, micro=3, releaselevel='final', serial=0)
import platform
print(platform.python_version())
import sys
print(sys.version)
python3 --versionpip3 --version
python --version #in command line
python #or by enterng interactiv mode
# To check your Python version in the command line use:
py --version
python3 -v
type py in cmd