当前位置:网站首页>实例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)运行结果:

↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓懒笑翻诚邀您点击下方群聊一起来学习讨论↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
边栏推荐
- 音乐播放器(未完成版本)
- RK3399平台开发系列讲解(内核驱动外设篇)6.35、IAM20680陀螺仪介绍
- 68:第六章:开发文章服务:1:内容梳理;article表介绍;创建【article】文章服务;
- Nodes in the linked list are flipped in groups of k
- Translating scientific and technological papers, how to translate from Russian to Chinese
- FPGA - Memory Resources of 7 Series FPGA Internal Structure -03- Built-in Error Correction Function
- 这款可视化工具神器,更直观易用!太爱了
- Merge k sorted linked lists
- Glide监听Activity生命周期源码分析
- shell脚本
猜你喜欢

12 Recurrent Neural Network RNN2 of Deep Learning

uni-app微信小程序——下拉多选框

This visual tool artifact is more intuitive and easy to use!love so much

【640. Solving Equations】

交换机和生成树知识点

阿里云新增三大高性能计算解决方案,助力生命科学行业快速发展

元宇宙社交应用,靠什么吸引用户「为爱发电」?

Common interview questions for APP UI automation testing, maybe useful~

BM13判断一个链表是否为回文结构

BM7 list entry in central
随机推荐
商家招募电商主播要考虑哪些内容
计算需要的MIPI lane数目
STL-deque
美味的石井饭
ASCII, Unicode and UTF-8
win系统下pytorch深度学习环境安装
camera preview process --- from HAL to OEM
shell programming without interaction
ArcGIS中的坐标系统和投影变换
B站数据分析岗实习生面试记录
企业云存储日常运行维护实践经验分享
How to translate financial annual report, why choose a professional translation company?
Pro-test is effective | A method to deal with missing features of risk control data
这款可视化工具神器,更直观易用!太爱了
Use Cloudreve to build a private cloud disk
Service - DHCP principle and configuration
Shell 编程--Sed
LeetCode Daily Question (1573. Number of Ways to Split a String)
BM13 determines whether a linked list is a palindrome
uni-app微信小程序——下拉多选框