Skip to content

Instantly share code, notes, and snippets.

@Kush1101
Created September 24, 2020 13:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Kush1101/97b2945099fd47fd64df54b4c6b36b40 to your computer and use it in GitHub Desktop.
Save Kush1101/97b2945099fd47fd64df54b4c6b36b40 to your computer and use it in GitHub Desktop.
from itertools import count
count_floating_negative = count(start=0.5, step = -0.5)
print(list(next(count_floating_negative) for _ in range(10)))
# OUTPUT
'''
[0.5, 0.0, -0.5, -1.0, -1.5, -2.0, -2.5, -3.0, -3.5, -4.0]
'''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment