News for hackers. Stuff that matters.
Re:Happy Birthday, Ruby by vram22 on Thursday January 10, 2019 @11:06AM (#18874828)
By coincidence, I had just posted this earlier and updated it recently:

  print(" ".join("FizzBuzz" if i % 15 == 0 \
  else "Buzz" if i % 5 == 0 else "Fizz" if i % 3 == 0 \
  else str(i) for i in range(1, 101)))
From:

FizzBuzz in Python with nested conditional expressions and a generator expression:

https://jugad2.blogspot.com/2018/12/fizzbuzz-in-python-with-...

Not claiming its the best in any way, just a way that I thought of.

Re:Happy Birthday, Ruby by fouc on Thursday January 10, 2019 @11:33AM (#18875124)
He asked for beautiful. Like if you showed it to a non-programmer, would they think it's beautiful?
Re:Happy Birthday, Ruby by vram22 on Thursday January 10, 2019 @11:41AM (#18875219)
1. So what? It's not always that case that people on HN reply (or must do so) to a question with an answer that exactly answers the question and nothing else. Diversions are fine and done a lot by users here, within reason. Otherwise these threads would look and sound like classes in logic or theorem proving, ha ha. We're humans here.

2. Why are you interpreting what he (or she) meant? Let them do it themselves.

3. I qualified my earlier comment as saying that it is not necessarily the best way - up front.

4. Beauty is in the eye of the beholder, and beholders vary a lot in their tastes, whether programmers or non-programmers. Like the "de gustibus" quote:

https://en.wikipedia.org/wiki/De_gustibus_non_est_disputandu...

So chill, pal.