T1 2019/8/20
01 #T1 用1,2,3,4创建一个各个位置之间互不相同的的四位数,并打印出来 02 num=range(1,5); 03 cal=0; 04 for one in num: 05 for two in num: 06 for three in num: 07 for four in num: 08 new_num = [one,two,three,four]; 09 if len(num) == len(set(new_num)): 10 value=one*1000+two*100+three*10+four; 11 cal += 1; 12 print(value); 13 print('there are '+str(cal)+' ways of ranking');