📜  python代码示例中的fizzbuzz

📅  最后修改于: 2022-03-11 14:46:14.708000             🧑  作者: Mango

代码示例4
def fizzBuzz(size):
    for i in range(size - (size -1), size + 1):
        localResult = "fizz" if not i % 3 else ""
        localResult = localResult + "buzz" if not i % 5 else localResult
        localResult = str(i) if localResult == "" else localResult
        print(localResult)