There is “no way” to subvert this FizzBuzz interview when writing code in Python 3 only.
def inf_range(a):
while True:
yield a
a += 1
def take(n, it):
return [a for a, b in zip(it, range(n))]
def fizzbuzz():
return (a + b or str(c) for a, b, c in zip(
(a for _ in inf_range(1) for a in (("", "", "Fizz"))),
(a for _ in inf_range(1) for a in (("", "", "", "", "Buzz"))),
inf_range(1)))
print(take(30, fizzbuzz()))
For bonus points: which alphanumeric characters can be changed in the code above?