Python note:For check type typechk.py
来源:互联网 发布:终结者2审判日 知乎 编辑:程序博客网 时间:2024/06/06 08:36
函数displayNumType()接受一个数值参数,使用内建函数type()来确认数值的类型(或不是一个数值类型)。
#!/usr/bin/env pythonimport syssys.setrecursionlimit(1000000)def displayNumType(num): print num, 'is', if isinstance(num, (int, long, float, complex)): print 'a number of type:', type(num)._name_ else: print 'not a number at all!' displayNumType(-69)displayNumType(99999999999L)displayNumType(98.6)displayNumType(-5.2+1.9j)displayNumType('xxx')
0 0
- Python note:For check type typechk.py
- 使用 uwsgi + web.py 遇到 “--no python application found, check your startup logs for errors--”
- 使用 uwsgi + web.py 遇到 “--no python application found, check your startup logs for errors--”
- Unknown command: 'makemigrations' Type 'manage.py help' for usage.
- Description Resource Path Location Type Unparsed aapt error(s)! Check the Check the console for outp
- Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: Python
- Check failed: registry.count(type) == 1 (0 vs. 1) Unknown layer type: Python
- python练习3——请写一个密码安全性检查的脚本代码:check.py
- no python application found, check your startup logs for errors
- python Note
- Python Note
- python note
- Python Note
- Python Note
- Python note
- Python Note
- Python note
- Python Note
- java打包的问题不像之前那么复杂。
- 关于java移位运算
- Java Spring Struts2 Hibernate maven example
- 关于php发邮件mail函数的一些处理
- ucosii学习 事件标志组
- Python note:For check type typechk.py
- Java并发编程 BlockingQueue
- 重装系统后恢复wubi安装Ubuntu
- hdu 1198 Farm Irrigation(深搜dfs || 并查集)
- STM32 液晶屏 显示字符串 中遇到的一个问题
- Objective-C学习笔记(一)
- UIColor+WebColor.h web色值、rgb色值转成UIColor
- 64位win8下安装和链接orcl12c
- 衡量ESB的方法