python version installed in ubuntu code example
Example 1: check all python versions ubuntu
for p in $(compgen -c python); do printf "%-16s" $p; $p --version; done
python2.7 Python 2.7.6
python3.4m Python 3.4.3
$ compgen -c python
python2.7
python3.4m
Example 2: check python version ubuntu
python3 --version
Example 3: python version installed in ubuntu
$ ls /usr/bin/python*
$ whereis python
$ which python
$ ls -lach /usr/bin/python
$ for p in $(compgen -c python); do printf "%-16s" $p; $p --version; done