详解Python中的type()方法的使用
作者:goldensun 时间:2022-01-03 03:11:06
type()方法返回传递变量的类型。如果传递变量是字典那么它将返回一个字典类型。
语法
以下是type()方法的语法:
type(dict)
参数
dict -- 这是字典
返回值
此方法返回传递变量的类型。
例子
下面的例子显示type()方法的使用
#!/usr/bin/python
dict = {'Name': 'Zara', 'Age': 7};
print "Variable Type : %s" % type (dict)
当我们运行上面的程序,它会产生以下结果:
Variable Type : <type 'dict'>
标签:Python
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python接口自动化之接口依赖
2021-09-03 15:53:09
![](https://img.aspxhome.com/file/2023/3/91893_0s.png)
发一个数字拼图网页游戏
2008-10-12 10:02:00
基于python3 的百度图片下载器的实现代码
2021-07-15 00:22:34
PHP _construct()函数讲解
2023-06-14 16:56:43
![](https://img.aspxhome.com/file/2023/3/55413_0s.png)
tensorflow 输出权重到csv或txt的实例
2021-07-19 11:54:52
python playwrigh框架入门安装使用
2023-05-07 23:18:51
![](https://img.aspxhome.com/file/2023/3/68453_0s.png)
python绘制规则网络图形实例
2021-08-31 02:28:28
Python实现的ftp服务器功能详解【附源码下载】
2021-12-23 08:30:55
![](https://img.aspxhome.com/file/2023/3/103673_0s.png)
SQL Server与Oracle、DB2的优劣对比
2009-01-07 14:16:00
利用Python写一个爬妹子的爬虫
2021-07-22 12:44:51
![](https://img.aspxhome.com/file/2023/1/72931_0s.png)
FileSystem对象常用的文件操作函数有哪些?
2009-11-01 15:11:00
pygame学习笔记(3):运动速率、时间、事件、文字
2023-05-20 21:19:38
![](https://img.aspxhome.com/file/2023/8/89238_0s.jpg)
设计MySQL数据库的技巧
2009-09-06 11:56:00
![](https://img.aspxhome.com/file/UploadPic/20099/6/20099612300822s.jpg)
js高亮关键词系列方法
2008-01-22 11:11:00
二级域名的解析指向ASP源码
2007-10-19 19:13:00
django序列化serializers过程解析
2022-09-26 22:22:36
Python面向对象之反射/自省机制实例分析
2022-07-27 06:57:53
Python中的zipfile模块使用详解
2023-02-26 22:44:37
python中*args与**kwarsg及闭包和装饰器的用法
2023-07-24 00:43:34
![](https://img.aspxhome.com/file/2023/6/60956_0s.png)
详解laravel安装使用Passport(Api认证)
2023-11-19 02:08:54
![](https://img.aspxhome.com/file/2023/9/89729_0s.png)