What is the correct fix?
for i in range(0, 1, 0.1):
print(i)
- Scale to ints:
range(0, 10)then divide - Scale to ints:
range(0, 10, 0.1)then divide - Change
rangetoenumeratein the loop - Cast the step with
int(0.1)beforehand
range only accepts integers; iterate whole numbers and divide inside the loop.
Play Problem Solving ▸