def fizzBuzz(n):
return ['Fizz' * (not i % 3) + 'Buzz' * (not i % 5) or str(i) for i in range(1, n+1)]
print(fizzBuzz(30))
fizzbuzz
最新推荐文章于 2023-09-07 01:32:18 发布
def fizzBuzz(n):
return ['Fizz' * (not i % 3) + 'Buzz' * (not i % 5) or str(i) for i in range(1, n+1)]
print(fizzBuzz(30))