Hacker News new | ask | show | jobs
by setpatchaddress 2070 days ago

  (1..100).each do |i|
   puts case
     when i % 15 == 0
       'FizzBuzz'
     when i % 3 == 0
       'Fizz'
     when i % 5 == 0
       'Buzz'
     else
       i
     end
   end
1 comments

Yes, cleaner, and no switch in Python.