b=int(input()) a=int(input()) for i in range(1,a+1): b=b+i sn=b-1 for i in range(1,a+1): i=a+1-i s="" ls=" "*(a-i) for j in range(1,i+1): if i==a or i==1: s=s+str(sn)+" " else: if j==1: s=s+str(sn)+" " elif 1<j<i: s=s+" " else: s=s+str(sn) sn-=1 print(ls+s)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter