Advertisement
here2share

# float_range.py

Sep 5th, 2023
888
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. # float_range.py
  2.  
  3. def float_range(start, stop, step=1.0):
  4.     while start < stop:
  5.         yield start
  6.         start += step
  7.  
  8. for x in float_range(1.0, 12.5, 0.5):
  9.     print(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement