数据类型转化,字符串格式化输出

1. 字典-->列表

arr = list(dic.items())             [( 'key', value ),()]

 

2.字符串格式化输出

 

print("{0:<10}{1:>5}".format('hello', 1234))

 0:<10  :左对齐

0:>5  右对齐

posted @ 2018-06-13 12:42  fight139  阅读(123)  评论(0编辑  收藏  举报