#!/usr/bin/python
l=0
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)
l+=1
print(l)
出错:i+=1 ^ TabError: inconsistent use of tabs and spaces in indentation exit status 1===>看不出来换到同一行上
#!/usr/bin/python
l=0
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);l+=1;print(l)
运行结果:正确
1 2 3
1
1 2 4
2
1 3 2
3
1 3 4
4
1 4 2
5
1 4 3
6