[Solved]: NameError: global name 'xrange' is not defined in Python 3

Solution:

You are trying to run a Python 2 codebase with Python 3. xrange() was renamed to range() in Python 3.

Replace

Python 2 xrange to

Python 3 range

Rest all same.