Category Built-in Methods

Python xrange: Meaning and Migration

Python xrange: Meaning and Migration

Updating Python code that uses xrange() starts with knowing which Python version the code targets. In Python 2, xrange() provides an immutable integer sequence for loops, while Python 3 uses range() for that job. This article explains what xrange() did…