FizzBuzz.py
for x in xrange(1,101):
if x % 3 is 0 and x % 5 is 0:
print "FizzBuzz"
elif x < 100 and x % 3 is 0:
print "Fizz"
elif x < 100 and x % 5 is 0:
print "Buzz"
else :
print x
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
More than 5 years have passed since last update.
for x in xrange(1,101):
if x % 3 is 0 and x % 5 is 0:
print "FizzBuzz"
elif x < 100 and x % 3 is 0:
print "Fizz"
elif x < 100 and x % 5 is 0:
print "Buzz"
else :
print x
Register as a new user and use Qiita more conveniently
Go to list of users who liked