函數:函數
- hex(x)
- 把整數爲前綴以「0x」的小寫十六進制字符串.
複製代碼
代碼:code
- >>> hex(255)
- '0xff'
- >>> hex(-25)
- '-0x19'
- >>> hex(0)
- '0x0'
- >>>
複製代碼
==============================
函數:字符串
代碼:class
- >>> oct(255)
- '0o377'
- >>> oct(25)
- '0o31'
- >>> oct(0)
- '0o0'
- >>>
複製代碼
==============================
函數:二進制
代碼:di
- >>> bin(255)
- '0b11111111'
- >>> bin(25)
- '0b11001'
- >>> bin(0)
- '0b0'
- >>>
複製代碼