#!/usr/local/bin/python3 from fractions import Fraction def drange(a, b, c): a = Fraction(a).limit_denominator() c = Fraction(c).limit_denominator() while a < b: yield float(a) a += c print(list(drange(17.8, 20, 0.1)))