range() for floats

As the comments mention, this could produce unpredictable results like: To get the expected result, you can use one of the other answers in this question, or as @Tadhg mentioned, you can use decimal.Decimal as the jump argument. Make sure to initialize it with a string rather than a float. Or even: And then: [editor’s not: if you only … Read more