当前位置:网站首页>Binary, octal, hexadecimal
Binary, octal, hexadecimal
2022-07-07 03:57:00 【Is it far? My Shangri La】
Number to string :bin()、oct()、hex()
>>> bin(15) # Binary system
'0b1111'
>>> oct(15) # octal
'0o17'
>>> hex(15) # Hexadecimal
'0xf'
String to number :int()
>>> int('0b1111',2) # Binary system
15
>>> int('0o17',8) # octal
15
>>> int('0xf',16) # Hexadecimal
15
Format display
>>> "{0:#x}".format(0xf) # Lowercase letters , Hexadecimal number
'0xf'
>>> "{0:#X}".format(0xf) # Capital
'0XF'
>>> "{0:#x}".format(15) # Lowercase letters , Decimal number
'0xf'
>>> "{0:x}".format(15) # Lowercase letters , Decimal number , Without prefix 0x
'f'
>>> "{0:0>8x}".format(255) # Occupy 8 Bit character , Align left , repair 0
'000000ff'
边栏推荐
- 10 ways of interface data security assurance
- 使用 BR 备份 TiDB 集群到 GCS
- VHDL implementation of single cycle CPU design
- MySQL storage engine
- Simple implementation of AVL tree insertion and verification operations
- Index of MySQL
- Que savez - vous de la sérialisation et de l'anti - séquence?
- Kotlin Android 环境搭建
- Open3D 网格滤波
- Restcloud ETL Community Edition June featured Q & A
猜你喜欢

Preprocessing - interpolation

【mysql】mysql中行排序

Confirm the future development route! Digital economy, digital transformation, data This meeting is very important

A 股指数成分数据 API 数据接口

【DPDK】dpdk样例源码解析之三:dpdk-l3fwd_001

tflite模型转换和量化
![[dpdk] dpdk sample source code analysis III: dpdk-l3fwd_ 001](/img/f6/dced69ea36fc95ef84bb546c56dd91.png)
[dpdk] dpdk sample source code analysis III: dpdk-l3fwd_ 001

Top 50 hit industry in the first half of 2022

Kbone与小程序跨端开发的一些思考

Machine learning notes - bird species classification using machine learning
随机推荐
Delete data in SQL
数据的存储
Search of linear table
R data analysis: how to predict Cox model and reproduce high score articles
C# Task拓展方法
Simple implementation of AVL tree insertion and verification operations
史上最全学习率调整策略lr_scheduler
Ubuntu 20 installation des enregistrements redisjson
太方便了,钉钉上就可完成代码发布审批啦!
Calculation of time and space complexity (notes of runners)
浅谈网络安全之文件上传
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
.net中 接口可以有默认实现了
10 ways of interface data security assurance
Docker部署Mysql8的实现步骤
Tflite model transformation and quantification
Summer 2022 daily question 1 (1)
24. (ArcGIS API for JS) ArcGIS API for JS point modification point editing (sketchviewmodel)
opencv第三方库
. Net interface can be implemented by default