In [1]: x = 5
In [2]: 2 < x < 6
Out[2]: True
In [3]: x > 2 and x < 6
Out[3]: True
In [4]: %timeit 2 < x < 6
79.2 ns ± 0.301 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)
In [5]: %timeit x > 2 and x < 6
80 ns ± 0.429 ns per loop (mean ± std. dev. of 7 runs, 10000000 loops each)