4个数字组成不重复的3位数python脚本:

注: 1、range(1,5),1-4不包括5 2、if and判断 3、变量中间用“,”隔开,输出时中间为空格

vi a1.py

#!/usr/bin/python

for i in range(1,5): for j in range(1,5): for k in range(1,5): if( i != k ) and ( i != j ) and ( j != k ): print i,j,k

:wq

python b1.py