标签:enter pre logs proc exit nbsp dict for print
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(leftwidth,‘.‘) + str(k).rjust(rightwidth)) printItem(dict,20,4)
----------Menu---------- banana.............. 10 pear................ 8 apple............... 4 Process finished with exit code 0
标签:enter pre logs proc exit nbsp dict for print
原文地址:http://www.cnblogs.com/leisurelyRD/p/7469954.html