1# Error:
2TypeError: 'float' object cannot be interpreted as an integer
3
4# Explanation:
5# This error usually comes up if you're trying to use floats in a
6# function/context that can only use integers. A common example is
7# trying to use floats in the range() function which only takes integers.
8
9# Solution:
10# A common way to get around this with range() is to use a multiple of
11# the float series you want and then to divide the resulting numbers
12# inside your loop. E.g.:
13for i in range(10):
14 print(i/10)
15--> 0.0
16 0.1
17 0.2
18 0.3
19 0.4
20 0.5
21 0.6
22 0.7
23 0.8
24 0.9
25
26# This way you can get the floats 0.0 - 0.9 without using floats in range