Replace removed xrange in Python3

Built-in function xrange were used in Python 2 were removed in
Python3. Python3 uses range, we use range() to support both
Python2 and Python3.

Change-Id: Ib4e4f833866ed6653f75e0ace67f1d9fa493babf
Closes-bug: #1256159
Merge "Replace removed xrange in Python3"