python hex() oct() bin() 内置函数
来源:互联网 发布:linux gpu使用率 编辑:程序博客网 时间:2024/05/16 01:16
说明:
>>> help(hex)Help on built-in function hex in module __builtin__:hex(...) hex(number) -> string Return the hexadecimal representation of an integer or long integer.>>> help(oct)Help on built-in function oct in module __builtin__:oct(...) oct(number) -> string Return the octal representation of an integer or long integer.>>> help(bin)Help on built-in function bin in module __builtin__:bin(...) bin(number) -> string Return the binary representation of an integer or long integer.>>>示例:
print hex(20),hex(-20) #转换成十六进制print oct(20),oct(-20) #转换成八进制print bin(20),bin(-20) #转换成二进制
结果:
0x14 -0x14
024 -024
0b10100 -0b10100
1 0
- python hex() oct() bin() 内置函数
- 6、内置函数hex, oct, bin,divmod的用法
- Python标准库:内置函数oct(x)
- python中hex,oct,chr,ord函数讲解
- Python标准库:内置函数hex(x)
- Python标准库:内置函数bin(x)
- Python内置函数学习(5)-bin(x)
- C++ hex和oct
- [C++] cout hex,oct,dec
- python各种类型转换-int,str,char,float,ord,hex,oct等
- python各种类型转换-int,str,char,float,ord,hex,oct等
- python各种类型转换-int,str,char,float,ord,hex,oct等
- python各种类型转换-int,str,char,float,ord,hex,oct等
- python各种类型转换-int,str,char,float,ord,hex,oct等
- python各种类型转换-int,str,char,float,ord,hex,oct等
- python各种类型转换-int,str,char,float,ord,hex,oct等
- python各种类型转换-int,str,char,float,ord,hex,oct等
- python各种类型转换-int,str,char,float,ord,hex,oct等
- 自定义view的一些记录
- scanf和gets的区别
- leetcode Valid Anagram
- python 登录接口测试
- 通用的单片机驱动lcd1602头文件,驱动液晶lcd1062的通用c语言头文件调用即可
- python hex() oct() bin() 内置函数
- 请求地址映射(@RequestMapping)
- Gsensor MMA8452Q传感器驱动及其datasheet
- 实验十:NAT技术实验
- OC的私有、保护、公有和KVC
- webview字体大小的修改
- 自己封装个dialog,满足一下报错信息的提示
- HTML5本地存储——Web SQL Database
- Factory 工厂模式