There are multiple ways in which you can check which is your current Python version.
Example 1: Know the current Python Version Command Line/Terminal
% python -V
Note: If you are using Python 3.x you will get an error,
# python -V
bash: python: command not found
% python -V
zsh: command not found: python
If you are using Python 3.x
% python3 -V
Python 3.10.8
% python3 --version

--version flag was introduced in Python 2.5
Example 2: Know current Python Version Programmatically
At times you may not have access to the terminal, for example, a hosted Notebook, in such case you may make use of Python code to programmatically know the version.
You can make use of the sys package to know the current Python version,
import sys
print("Current Python version is: ",sys.version)
Output:
Current Python version is: 3.10.8 (main, Oct 21 2022, 22:22:30) [Clang 14.0.0 (clang-1400.0.29.202)]

Above is a screenshot of Google Colab Notebook, where the code was executed and the version obtained is 3.10.8.
-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to Python,
- Python: Convert Date to DateTime
- How to sort a List using Lambda in Python
- Python matplotlib segmentation fault: 11 macOS Big Sur
- What is Terminal Velocity and its Formula? How to calculate it programmatically?
- How to install Python 3.11 on Mac
- How to flatten a nested list in Python
- Python: Pandas Merge DataFrames on Index Example
- How to Run all Cells at Once Jupyter Notebook
- Python - Convert float to String
- How to add borders to tkinter label text
- How to Exit a Loop in Python Code
- [Python] Fix: ValueError: All arrays must be of the same length
- Sorting an array using Bubble Sort in Python Programming
- How to Unzip a file using Python
- Python: Merge DataFrames Pandas Outer Join Example
- Change label (text) color in tkinter
- Convert Float to String in Python
- Fix: fatal error: No such file or directory compilation terminated
- Python: Access index/counter of a for loop iteration
- Import Other Python Files Examples
- How to install Anaconda on Mac (M1/M2 Mac)
- Python Regular Expression to Find All Matches in List
- How to Read a binary File with Python
- How to disable warnings while Python file execution
- Know current Python Version
More Posts:
- Change battery percentage in Android Emulator - Android
- Facebook | Error : Sorry, something went wrong We're working on it and we'll get it fixed as soon as we can - Facebook
- Git Remove Untracked Files using Command - Git
- How to Exit a File in Terminal (Bash/Zsh) - Linux
- Notepad++ Replace space with Dot - NotepadPlusPlus
- [Solution] Installing Whatsapp There's insufficient space on the device - WhatsApp
- Java Program to generate random string - Java
- Open VS Code Command Palette using Keyboard Shortcut - Shortcuts