def shape(n): for i in range(2*n+ 1): if (i < n): print "$" * (n - i) + "*" * 2 * i + "$" * (n - i) elif i == n: print "*" * 2 * n elif i > n: print "&" * (i - n) + "*" * 2 * (2* n - i) + "&" * (i - n)
欢迎分享,转载请注明来源:内存溢出
def shape(n): for i in range(2*n+ 1): if (i < n): print "$" * (n - i) + "*" * 2 * i + "$" * (n - i) elif i == n: print "*" * 2 * n elif i > n: print "&" * (i - n) + "*" * 2 * (2* n - i) + "&" * (i - n)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)