return [str(i) if (i%3!=0 and i%5!=0) else (('Fizz'*(i%3==0)) + ('Buzz'*(i%5==0))) for i in range(1,n+1)]
Here's my version which is a bit shorter:
def fizzBuzz(self, n): return [(not i%3)*"Fizz" + (not i%5)*"Buzz" or str(i) for i in range(1, n+1)]
@michael164 unless I was considering Python 3 users! ;)
@ahendy That's really cool!
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.