This post is inspired by Jeff Atwood's blog postWhy Can't Programmers.. Program? So I thought of writing a FizzBuzz myself. I was successful (according to me ;) ) in writing those, but later after some googling I understood there was a better way for it. The code I presented here is the latest version and you can checkout my initial version of FizzBuzz here. If you are interested more, you can check out the more complex versions of FizzBuzz in a reddit discussion.
FizzBuzz in ruby
FizzBuzz in Python
FizzBuzz in PHP
If you have a better version, please share it with me. Thank you