if __name__ == '__main__':
import pprint
data = (
"this is a string",
[1, 2, 3, 4, {"name": "python", "age": 30}],
("more tuples", 1.0, 2.3, 4.5),
"this is yet another string"
)
pprint.pprint(data, indent=4, width=20, depth=2)
( 'this is a '
'string',
[ 1,
2,
3,
4,
{...}],
( 'more '
'tuples',
1.0,
2.3,
4.5),
'this is yet '
'another '
'string')
本系列文章和代码已经作为项目归档到github,仓库地址:jumper2014/PyCodeComplete。大家觉得有帮助就请在github上star一下,你的支持是我更新的动力。什么?你没有github账号?学习Python怎么可以没有github账号呢,快去注册一个啦!