用字母打印菱形

num1=list(range(1,10,2))
num2=list(range(7,0,-2))

list1=num1+num2
#print(list1)
for j in list1:
print(("*" *j).center(10))

for i in list1[:5]:
print((chr(ord(“A”)+(i-1)//2)*i).center(9))
for i in list1[5:]:
print((chr(ord(“E”)+(9-i)//2)*i).center(9))
用字母打印菱形

上一篇:ycsb工具之hbase测试


下一篇:合并两个有序链表