Comment

Comment by jamesdhutton

Nice idea. Here is the (rough) equivalent in Python.

  from itertools import cycle
  fizz = cycle(['', '', 'Fizz'])
  buzz = cycle(['', '', '', '', 'Buzz'])
  for n in range(1, 100):
      fizzbuzz = next(fizz) + next(buzz)
      print (fizzbuzz if fizzbuzz else n)

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton