使用 pPRint 模塊
pprint 模塊( pretty printer )
用于打印 Python 數據結構. 當你在命令行下打印特定數據結構時你會發現它很有用(輸出格式比較整齊, 便于閱讀).
import pprintdata = (    "this is a string", [1, 2, 3, 4], ("more tuples",    1.0, 2.3, 4.5), "this is yet another string"    )pprint.pprint(data)('this is a string',[1, 2, 3, 4],('more tuples', 1.0, 2.3, 4.5),'this is yet another string')
新聞熱點
疑難解答