你能用python帮助打印下面的代码吗
4444444 4333334 4322234 4321234 4322234 4333334 4444444
我尝试了下面的,但是因为我是新来的,所以对使用哪个代码有点困惑,我们如何按照下面的顺序得到数字
ubbxdtey1#
def print_pattern(): for i in range(4): for j in range(7): if abs(3 - i) <= abs(3 - j): print(abs(3 - i) + 1, end='') else: print(abs(3 - j) + 1, end='') print() print_pattern()
1条答案
按热度按时间ubbxdtey1#