Simplify Chained Comparison

In Python you can “chain” comparison operations which just means they are “and”ed together. In your case, it’d be like this:

if start <= x <= end:

Reference: https://docs.python.org/3/reference/expressions.html#comparisons

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)