成免费的crm,久久国产精品新农夫导航新妓网,恋夜秀场全部视频安卓手机,女校花强奷在线播放A级

Python 字典 Dictionary str()方法

Python 字典 Dictionary str()方法

Python 字典 DictionaryPython 字典 Dictionary

Python 字典(Dictionary) str() 函數(shù)將值轉(zhuǎn)化為適于人閱讀的形式,以可打印的字符串表示。

 

語(yǔ)法

str()方法語(yǔ)法:

str(dict)

 

參數(shù)

  • dict -- 字典。

 

返回值

返回字符串。

 

實(shí)例

以下實(shí)例展示了 str()函數(shù)的使用方法:

 

實(shí)例

#!/usr/bin/python

dict = {'Name': 'Zara', 'Age': 7};
print "Equivalent String : %s" % str (dict)    

以上實(shí)例輸出結(jié)果為:

Equivalent String : {'Age': 7, 'Name': 'Zara'}

Python 字典 DictionaryPython 字典 Dictionary

下一節(jié):Python 字典(Dictionary) type()方法

Python 教程

相關(guān)文章