001、假定数字为3
[root@pc1 test1]# ls test.py [root@pc1 test1]# cat test.py ## 测试程序 #!/usr/bin/env python3 # -*- coding: utf-8 -*- for i in range(1,4): for j in range(1,4): if j == i: continue for k in range(1,4): if k == j or k == i: continue print(str(i) + str(j) + str(k)) [root@pc1 test1]# python3 test.py ## 程序运行结果 123 132 213 231 312 321
.
标签:test1,排列,pc1,数字,python,py,range,str,test From: https://www.cnblogs.com/liujiaxin2018/p/17736450.html