https://blog.csdn.net/hanhanwanghaha宝藏女孩 欢迎您的关注!
欢迎关注微信公众号:宝藏女孩的成长日记
如有转载,请注明出处(如不注明,盗者必究)
代码:
#coding=utf-8
for i in range(10):
for j in range(0, 10 - i):
print(end=" ")
for k in range(10 - i, 10):
print("*", end=" ")
print("")
代码:
#coding=utf-8
for i in range(10):
for j in range(0, i):
print(end=" ")
for k in range(i, 10):
print("*", end=" ")
print("")
代码:
#coding=utf-8
for i in range(10):
for j in range(0, 10 - i):
print("*", end=" ")
print("")
代码:
#coding=utf-8
for i in range(10):
for j in range(0, i):
print("*", end=" ")
print("")
代码:
#coding=utf-8
for i in range(10):
for j in range(0,i):
print(" ", end=" ")
for k in range(i,10):
print("*", end=" ")
print("")
运行结果:
代码:
#coding=utf-8
for i in range(10):
for j in range(0, 10 - i):
print(" ", end=" ")
for k in range(10 - i, 10):
print("*", end=" ")
print("")