Discussion about this post

User's avatar
Wyrd Smythe's avatar

On the page you linked to about the FizzBuzz test, there's a comment to the effect that Real Developers, upon learning about the FizzBuzz test, *immediately* go off and see what they can whip up quickly. Which cracked me up, because that's exactly what I did. 😂

An obvious works-in-any-language solution took about a minute, but I took another minute to make a particularly Python-ish version:

threes = ["Fizz" if n%3 == 0 else "" for n in range(1,101)]

fives = ["Buzz" if n%5 == 0 else "" for n in range(1,101)]

for n,x3,x5 in zip(range(1,101), threes, fives): print(f'{n:3d}: {x3}{x5}')

print()

That comment also mentions that Real Developers can't resist posting their solutions… 🙄

Expand full comment
André Roberge's avatar

This is a fantastic idea. It's simple, obvious in retrospect, but not something I've seen mentioned before.

Expand full comment
1 more comment...

No posts