上一页 1 ··· 4 5 6 7 8

2017年9月3日

方法ljust/rjust/center

摘要: dict = {'apple':4,'banana':10,'pear':8} def printItem(dictName,leftwidth,rightwidth): print("Menu".center(leftwidth+rightwidth,'-')) for i,k in dictName.items(): print(i.ljust(leftwi... 阅读全文

posted @ 2017-09-03 16:43 winecork 阅读(91) 评论(0) 推荐(0) 编辑

字符串计数

摘要: import pprint text = "aaaa bbbb ccc dd ee ff gg h i j kkkk" count = {} for i in text: count.setdefault(i,0) count[i] = count[i] + 1 # pprint.pprint(count) print(pprint.pformat(count)) 阅读全文

posted @ 2017-09-03 15:51 winecork 阅读(96) 评论(0) 推荐(0) 编辑

2017年8月27日

pycharm主题设置

摘要: File>Settings: Appearance & Behavior>Appearance>Theme:Darcula Editor>Color & Fonts>Python>Scheme:Darcula 阅读全文

posted @ 2017-08-27 22:18 winecork 阅读(110) 评论(0) 推荐(0) 编辑

上一页 1 ··· 4 5 6 7 8

导航