Python 基礎(chǔ)教程
Python 字典(Dictionary) type() 函數(shù)返回輸入的變量類型,如果變量是字典就返回字典類型。
type()方法語法:
type(dict)
返回輸入的變量類型。
以下實例展示了 type()函數(shù)的使用方法:
#!/usr/bin/python dict = {'Name': 'Zara', 'Age': 7}; print "Variable Type : %s" % type (dict)
以上實例輸出結(jié)果為:
Variable Type : <type 'dict'>其他擴(kuò)展