How to output this template in Python
Can this be done with the for loop? Help friends thanks
CodePudding user response:
How to output this template in for loop in Python
CodePudding user response:
rows = 9
for i in range(1, rows):
for i in range(0, i, 1):
print(format(2 ** i, "4d"), end=' ')
for i in range(-1 i, -1, -1):
print(format(2 ** i, "4d"), end=' ')
print("")