Python dict str()生成字典的可打印字符串表示。
str(dict)
dict - 这是字典。
此方法返回字符串表示形式。
链接:https://www.learnfk.comhttps://www.learnfk.com/python/dictionary-str.html
来源:LearnFk无涯教程网
以下示例显示了str()方法的用法。
#!/usr/bin/python dict={'Name': 'Learnfk', 'Age': 7}; print "Equivalent String : %s" % str (dict)
当无涯教程运行上面的程序时,它产生以下输出-
Equivalent String : {'Age': 7, 'Name': 'Learnfk'}
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)