Skip to content

Instantly share code, notes, and snippets.

@bazuzu931
Created December 10, 2023 08:23
Show Gist options
  • Select an option

  • Save bazuzu931/ca631dacc110ba611d939b129cac1cb2 to your computer and use it in GitHub Desktop.

Select an option

Save bazuzu931/ca631dacc110ba611d939b129cac1cb2 to your computer and use it in GitHub Desktop.
loop float - python
def decimal_range(start, stop, increment):
while start < stop: # and not math.isclose(start, stop): Py>3.5
yield start
start += increment
for i in decimal_range(0.1, 10.1, 0.1):
i = round(float(i), 1)
print(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment