Created
December 10, 2023 08:23
-
-
Save bazuzu931/ca631dacc110ba611d939b129cac1cb2 to your computer and use it in GitHub Desktop.
loop float - python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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