【发布时间】:2025-12-30 23:45:18
【问题描述】:
我将如何确定一个整数是否是 2 的倍数但不是 3 的倍数 print' is a multiple of 2 only.' ?使用python。
if myint%2:
print(str(myint), "is a multiple of 2 only")
如何让它输出“但不是 3 的倍数”
【问题讨论】:
-
这是 FizzBuzz。它很受欢迎。请谷歌一下。
标签: python python-2.7 python-3.x if-statement boolean