2019年5月15日 星期三

print 之 format

for i in range(5):
    print("{:<10}".format("*")) #空格10 向左靠齊
    print("{:>10}".format("*")) #空格10 向靠齊
    print("{:^10}".format("*")) #空格10 向中靠齊


===========

沒有留言:

張貼留言