当前位置:网站首页>实例052:按位或
实例052:按位或
2022-08-10 22:20:00 【懒笑翻】
题目:学习使用按位或 | 。
程序分析:0|0=0; 0|1=1; 1|0=1; 1|1=1
# 只要对应的二个二进位有一个为1时,结果位就为1
代码:
a = 0o77
print(a)
print(a | 3)
print(a | 3 | 7)
运行结果:
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓懒笑翻诚邀您点击下方群聊一起来学习讨论↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
边栏推荐
- 2022年8月10日:使用 ASP.NET Core 为初学者构建 Web 应用程序--使用 ASP.NET Core 创建 Web UI(没看懂需要再看一遍)
- 高学历毕业生,该学单片机还是plc?
- 带着昇腾去旅行:一日看尽金陵城里的AI胜景
- 商家招募电商主播要考虑哪些内容
- 从斐波那契 - 谈及动态规划 - 优化
- 【640. Solving Equations】
- QT笔记——用VS + qt 生成dll 和 调用生成的dll
- LeetCode Daily 2 Questions 01: Reverse Strings (both 1200) Method: Double Pointer
- Distribution Network Expansion Planning: Consider Decisions Using Probabilistic Energy Production and Consumption Profiles (Matlab Code Implementation)
- 《DevOps围炉夜话》- Pilot - CNCF开源DevOps项目DevStream简介 - feat. PMC成员胡涛
猜你喜欢
[Maui official version] Create a cross-platform Maui program, as well as the implementation and demonstration of dependency injection and MVVM two-way binding
Addition of linked lists (2)
“数据引擎”开启前装规模量产新赛道,「智协慧同」崭露头角
3598. 二叉树遍历(华中科技大学考研机试题)
Service - DNS forward and reverse domain name resolution service
virtual address space
企业云存储日常运行维护实践经验分享
电力系统潮流计算(牛顿-拉夫逊法、高斯-赛德尔法、快速解耦法)(Matlab代码实现)
Translating scientific and technological papers, how to translate from Russian to Chinese
How to be a Righteous Hacker?What should you study?
随机推荐
A shell script the for loop statements, while statement
DC-7靶场下载及渗透实战详细过程(DC靶场系列)
QT笔记——QT工具uic,rcc,moc,qmake的使用和介绍
OneNote 教程,如何在 OneNote 中整理笔记本?
瑞幸咖啡第二季营收33亿:门店达7195家 更换CFO
Redis
DC-9靶场下载及渗透实战详细过程(DC靶场系列)
Shell programming specification and variables
BM13 determines whether a linked list is a palindrome
An article to teach you a quick start and basic explanation of Pytest, be sure to read
分享一个后台管理系统可拖拽式组件的设计思路
The Thread State,
2021 IDEA creates web projects
服务——DNS正向反向域名解析服务
【软件测试】2022年最火的十大测试工具,你掌握了几个
LabVIEW分配多少线程?
ASCII, Unicode and UTF-8
OneNote tutorial, how to organize notebooks in OneNote?
Service - DHCP principle and configuration
LeetCode Daily Question (1573. Number of Ways to Split a String)