n=4
w=2*n+1
for i in range(1,n+1):
x=list(map(str,list(range(1,i+1))))
print(" ".join(x).center(w))
change the value of n to change output
code is in python 3
20th Oct 2016, 8:08 AM
Sunera
Vous avez souvent des questions comme celle-ci ?
Apprenez de maniĂšre plus efficace, gratuitement :