python version in python script code example Example 1: python version python ––version Example 2: python version command import sys print(sys.version)