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

↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓懒笑翻诚邀您点击下方群聊一起来学习讨论↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
边栏推荐
猜你喜欢
随机推荐
爬虫request.get()出现错误
Nodes in the linked list are flipped in groups of k
LeetCode每日两题01:反转字符串 (均1200道)方法:双指针
Self-organization is a two-way journey between managers and members
高学历毕业生,该学单片机还是plc?
FPGA - Memory Resources of 7 Series FPGA Internal Structure -03- Built-in Error Correction Function
云服务器基于 SSH 协议实现免密登录
高数_复习_第5章:多元函数微分学
LeetCode Daily 2 Questions 01: Reverse Strings (both 1200) Method: Double Pointer
JS中使用正则表达式g模式和非g模式的区别
ASCII、Unicode和UTF-8
pytorch手撕CNN
留言有奖|OpenBMB x 清华大学NLP:大模型公开课更新完结!
Service - DNS forward and reverse domain name resolution service
Power system power flow calculation (Newton-Raphson method, Gauss-Seidel method, fast decoupling method) (Matlab code implementation)
2021IDEA创建web工程
亲测有效|处理风控数据特征缺失的一种方法
Conditional Statements of Shell Programming (2)
Redis
fme csmapreprojector转换器使用高程异常模型进行高程基准转换









