这篇教程Python 字典(Dictionary) type()方法写得很实用,希望能帮到您。 描述Python 字典(Dictionary) type() 函数返回输入的变量类型,如果变量是字典就返回字典类型。 语法type()方法语法: type(dict) 参数返回值返回输入的变量类型。 实例以下实例展示了 type()函数的使用方法: #!/usr/bin/pythondict = {'Name': 'Zara', 'Age': 7};print "Variable Type : %s" % type (dict) 以上实例输出结果为: Variable Type : <type 'dict'> Python 字典(Dictionary) str()方法 Python time altzone()方法 |