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

↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓懒笑翻诚邀您点击下方群聊一起来学习讨论↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
边栏推荐
- “数据引擎”开启前装规模量产新赛道,「智协慧同」崭露头角
- mmpose关键点(一):评价指标(PCK,OKS,mAP)
- 配电网络扩展规划:考虑使用概率性能源生产和消费概况的决策(Matlab代码实现)
- What are the concepts, purposes, processes, and testing methods of interface testing?
- What is Jmeter? What are the principle steps used by Jmeter?
- camera preview process --- from HAL to OEM
- 测试4年感觉和1、2年时没什么不同?这和应届生有什么区别?
- xshell (sed command)
- 链表相加(二)
- Pro-test is effective | A method to deal with missing features of risk control data
猜你喜欢

合并k个已排序的链表

字节跳动原来这么容易就能进去...

Conditional Statements of Shell Programming (2)

高数_复习_第5章:多元函数微分学

BM13 determines whether a linked list is a palindrome

Use Cloudreve to build a private cloud disk

LeetCode每日两题02:反转字符串中的单词 (均1200道)

学会开会|成为有连接感组织的重要技能

68:第六章:开发文章服务:1:内容梳理;article表介绍;创建【article】文章服务;

LeetCode Daily 2 Questions 02: Reverse the words in a string (1200 each)
随机推荐
JS use regular expressions in g model and non g difference
合并k个已排序的链表
Research on multi-element N-k fault model of power system based on AC power flow (implemented by Matlab code) [Power System Fault]
QT笔记——QT工具uic,rcc,moc,qmake的使用和介绍
Black cat takes you to learn Makefile Part 11: When the header file a.h changes, how to recompile all the .c files that depend on the header file a.h
“数据引擎”开启前装规模量产新赛道,「智协慧同」崭露头角
基于交流潮流的电力系统多元件N-k故障模型研究(Matlab代码实现)【电力系统故障】
Detailed installation steps and environment configuration of geemap
QT笔记——vs + qt 创建一个带界面的 dll 和 调用带界面的dll
艺术与科技的狂欢,阿那亚2022砂之盒沉浸艺术季
ASCII、Unicode和UTF-8
DC-7靶场下载及渗透实战详细过程(DC靶场系列)
Use Cloudreve to build a private cloud disk
Spark基础【RDD转换算子】
MySQL Advanced Commands
B站数据分析岗实习生面试记录
2021IDEA创建web工程
shell编程之免交互
字节跳动原来这么容易就能进去...
IM 即时通讯开发如何设计图片文件的服务端存储架构