for i in range(1,101): print "FizzBuzz" if i %3 == 0 and i % 5 == 0 else "Fizz" if i % 3 == 0 else "Buzz" if i % 5 == 0 else str(i)
Scores 69 in python but the login/signup is broken :)
Scores 69 in python but the login/signup is broken :)
for i in range(1,101):print'FizzBuzz'[i*i%3*4:8--i**4%5]or i
Pastebin of my explanation: http://pastebin.com/raw.php?i=00Db30FFEDIT: ugh, sometimes I hate markdown, moved post to pastebin.
i=1
while i<101:print'FizzBuzz'[i*i%3*4:8--i**4%5]or i;i+=1 n=1
while n<101:print'Fizz'*(n%3<1)+'Buzz'*(n%5<1)or n;n+=1 n%-3&4
unbelievably it works for i in range(1,101):print 'FizzBuzz' if not i%15 else 'Fizz' if not i%3 else 'Buzz' if not i%5 else iEven a little shorter :)
for i in range(1,101):print "Fizz" if not i%3 else '' + "Buzz" if not i%5 else str(i) if (i%3) else ''
Edit: Down to 82 characters now. I'm not sure if this would work on every Python, but it works on mine. for i in range(1,101):print(("Fizz"if i%3==0 else'')+("Buzz"if i%5==0 else''))or i for i in range(1,101):print("Fizz"if i%3==0 else'')+("Buzz"if i%5==0 else'')or i for i in range(1,101):print(''if i%3 else'Fizz')+(''if i%5 else'Buzz')or i for x in range(1,101):print['','Fizz'][x%3==0]+['','Buzz'][x%5==0]or x for x in range(1,101):print['','Fizz'][x%3<1]+['','Buzz'][x%5<1]or x n=1
while n<101:print'Fizz'*(n%3<1)+'Buzz'*(n%5<1)or n;n+=1
And here is a wacky one in 96 chars w=range(101)
w[::3]=['Fizz']*34
w[::5]=['Buzz']*21
w[::15]=['FizzBuzz']*7
for s in w[1:]:print s n=1;exec"print'Fizz'*(n%3<1)+'Buzz'*(n%5<1)or n;n+=1;"*100derp, works better of course
Though I can't find out the score the page to test the code seems to be inaccessible if you are signed in. It just redirects you to the signed in page and the signout link is broken. Still it's a fun and cool idea