美文网首页
Python——有1、2、3、4个数字,能组成多少个互不相同且无

Python——有1、2、3、4个数字,能组成多少个互不相同且无

作者: 蓝剑狼 | 来源:发表于2018-08-31 12:33 被阅读210次
i = 0
for x in range(1,5):
    for y in range(1,5):
        for z in range(1,5):
                if (x != y) and (y != z) and (z != x):
                    i += 1
                    # 变通特殊处理
                    if i % 3:
                        print("%d%d%d" % (x, y, z), end=" | ")
                    else:
                        print("%d%d%d" % (x, y, z))
print((7 % 3) and True)
print(False and True)
print(not 0)
print(not 6)
print(0 or True)
print((3 < 4) and (4 < 5))

相关文章

网友评论

      本文标题:Python——有1、2、3、4个数字,能组成多少个互不相同且无

      本文链接:https://www.haomeiwen.com/subject/pbsswftx.html