type()
2016-04-05 23:25
363 查看
pi@raspberrypi ~ $ python Python 2.7.3 (default, Mar 18 2014, 05:13:23) [GCC 4.6.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> type('') <type 'str'> >>> s = 'xyz' >>> type(s) <type 'str'> >>> type(100) <type 'int'> >>> type(0+0j) <type 'complex'> >>> type(0) <type 'int'> >>> type(0) >>> type(0) >>> type(0) >>> type(0L) <type 'long'> >>> type(0.0) <type 'float'> >>> type([]) <type 'list'> >>> type(()) <type 'tuple'> >>> type({}) <type 'dict'> >>> type(type) <type 'type'> >>> type(type) <type 'type'> >>> class Foo:pass ... >>> type(Foo) <type 'classobj'> >>> foo = Foo() >>> >>> type(foo) <type 'instance'> >>> class Bar(object): pass ... >>> bar = Bar() >>> type(Bar) <type 'type'> >>> type(Bar) <type 'type'> >>> bar = Bar() >>> type(Bar) <type 'type'> >>> type(bar) <class '__main__.Bar'> >>>
相关文章推荐
- H3C汇聚层交换机认证在线人数展示系统之需求说明和功能点说明
- stm32小小中断学习
- Java Servlet Development Without Eclipse
- eclipse中新建Java工程的三个JRE选项区别
- HDU 5657 CA Loves Math 状压DP + 枚举
- Android屏幕适配
- Xcode7.3更新后插件失效的解决方法
- Vulkan Instance
- swift基本语法(总结提炼版)之012 swift 之闭包
- 关于new Function使用以及将json格式字符串转化为json对象方法介绍
- Javase 笔记知识点概要
- POJ3613 Cow Relays
- 我的python书写约定
- 第48课 函数设计原则(完)
- RxJava-过滤操作符
- hdu-1078 FatMouse and Cheese
- C#Base64编码
- 浏览器返回错误大全
- 初等数论_5 2016.4.6
- php和javascript交互篇(一)