import sys
from sys import platform, version_info

if sys.version_info[:1] == (2, 7): ...  # Y005
if sys.version_info[:2] == (2,): ...  # Y005


if sys.version_info[0] == 2: ...
if version_info[0] == 2: ...
if sys.version_info < (3, 5): ...
if version_info >= (3, 5): ...
if sys.version_info[:2] == (2, 7): ...
if sys.version_info[:1] == (2,): ...
if platform == 'linux': ...
