代码如下:
for i in range(1,6):
print (2*i-1)*'.'
Python for 循环语句流程图:
for i in range(1,6):
print (2*i-1)*'.'
for i in range(n):
print('%s%s%s' % (' ' * i, '*' * (n - 2 * i), ' ' * i))
import turtle
for a in range(0,3):
turtle.setheading(0)
turtle.forward(100)
turtle.left(120)
for a in range(10):
print a * '0'
看看像不像三角形?