以下代码功能是:不论你输入一句多长的句子,都能建造相应大小盒子并且语句在盒子居中。。。#!/usr/bin/envpython
#定义
sentence=raw_input("Sentence:")
screen_with=80
text_width=len(sentence)
box_width=text_width+6
left_margin=(screen_with-text_width)//2
#画盒子..
分类:
编程语言 时间:
2015-10-25 19:31:39
阅读次数:
147