Fizz-buzz is a very basic interview question mainly asked to see if a developer/programmer can actually code or not. Nothing too sophisticated.I was asked to code a FizzBuzz today for the second time in my life and I thought why not to blog about it, since it seems to be getting popular to ask from developers. To make it a bit challenging for myself, I coded it in Python, since I have the least skill in coding Python, although I think it is a sexy language.
Solution:
__author__ = 'amir'
for x in range(1, 100):
if x % 15 == 0:
print 'fizzbuzz'
elif x % 3 == 0:
print 'fizz'
elif x % 5 == 0:
print 'buzz'
else:
print x