#coding=utf-8 def init_set(): r10=range(10) return [(i, j, k, l) for i in r10 for j in r10 for k in r10 for l in r10 if (i != j and i != k and i != l and j != k and j != l and k != l) ] #对给定的两组数,计算xAyB.不知道能不能更快些 def get_match_ab(target, source): la,
使用Python输出一个数字金字塔 运行结果: 源代码: ''' Python输出数字金字塔 ''' for x in range(1,10): print(' '*(15-x),end='') n=x while n>=1: print(n,sep='',end='') n-=1 n+=2 while n<=x: print(n,sep='',end='') n+=1 print()