To check the Python version on Ubuntu, you can use the following command in the terminal:
python3 --version
This command will display the version of Python 3 installed on your system. Note that Python 2 is not typically installed by default on Ubuntu anymore, so using python without the 3 suffix should also give you the Python 3 version. However, it's always recommended to use python3 explicitly to ensure you're using Python 3.
If the python3 command is not recognized, you may need to install Python 3 by running the following command:
sudo apt-get install python3
Once installed, you should be able to check the Python version using the python3 --version command.