Python Range Method Syntax Vs Query