Error: range () integer and argument expected, got float

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.