I was trying to have a program using Python to create a "pyramid" based on a number, n, out of o's and came up with this: ( I would print nn, that would be the lines.)
n = 0
n += 2 #just another way to show n=n+2
nn = n, "o" #nn would be an amount of o's, based on what #n was
print (nn, str.center(40, " "))
This will be the answer to your question
import time n = 0 while True: n += 2 nn = n * "o" time.sleep(1) print (nn.center(40, " ")) if n > 30: break
The reason why they have put
time.sleep(1) is to make it look like an animation.
print (nn, str.center(40, " ")) this must be changed to
nn.center(40, " ") as
.center is a method of string.