python學習筆記1-字符串的使用

字符串運算+和*的例子: 輸出一個方框包裹的字符 sentence = input("sentence:") screen_width = 80 text_width = len(sentence) box_width = text_width  left_margin = (screen_width-box_width)//2 print(" "*left_margin+"+"+"-"*box_
相關文章
相關標籤/搜索