Python 字典(Dictionary) type()方法

栏目: 编程语言 · Python · 编程教程 · python 教程 · 发布时间: 8年前

内容简介:Python 字典(Dictionary) type() 函数返回输入的变量类型,如果变量是字典就返回字典类型。

描述

Python 字典(Dictionary) type() 函数返回输入的变量类型,如果变量是字典就返回字典类型。

语法

type()方法语法:

type(dict)

参数

  • dict -- 字典。

返回值

返回输入的变量类型。

实例

以下实例展示了 type()函数的使用方法:

#!/usr/bin/python

dict = {'Name': 'Zara', 'Age': 7};
print "Variable Type : %s" %  type (dict)

以上实例输出结果为:

Variable Type : <type 'dict'>

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Algorithms

Algorithms

Robert Sedgewick、Kevin Wayne / Addison-Wesley Professional / 2011-3-19 / USD 89.99

Essential Information about Algorithms and Data Structures A Classic Reference The latest version of Sedgewick,s best-selling series, reflecting an indispensable body of knowledge developed over the ......一起来看看 《Algorithms》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

URL 编码/解码
URL 编码/解码

URL 编码/解码

html转js在线工具
html转js在线工具

html转js在线工具