I have been able to solve this problem by upgrading my python environment to python3. You can upgrade by following the instructions here. Please kindly make sure that all custom app installed support python3 before upgrading as this can cause issues. I hope someone finds this helpful
The problem is mainly because of the float value in range function. Python range function does not accept floating point numbers as arguments, so you must use integers.
Range(start value, end value, step)
If it’s old code, it would have worked on Python 2. Integer division in Python 2 produces another integer. In Python 3 it produces a float.