check_version.py
import sys
v = sys.version_info
print(v)
if (v.major == 3 and v.minor >= 7) or (v.major >= 4):
print('version 3.7 or more')
if (v.major == 3 and v.minor <= 7) or (v.major <= 2):
print('version 3.7 or less')
# > python check_version.py
# sys.version_info(major=3, minor=12, micro=4, releaselevel='final', serial=0)
# version 3.7 or more