手记

python 打印空心正方形

#打印出一个空心正方形
num = input ("zheng fang xing bian chang :")
num = int(num)
for i in range(num):
if i == 0 or i == (num-1):
print ("#\t"num)
else:
print ("#"+"\t"
(num-1)+"#")

0人推荐
随时随地看视频
慕课网APP