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

↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓懒笑翻诚邀您点击下方群聊一起来学习讨论↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
边栏推荐
- 亲测有效|处理风控数据特征缺失的一种方法
- 自学软件测试不知道该如何学起,【软件测试技能图谱|自学测试路线图】
- 云服务器基于 SSH 协议实现免密登录
- 美味石井饭菜
- 高数_复习_第5章:多元函数微分学
- 罗克韦尔AB PLC RSLogix5000中计数器指令使用方法介绍
- VulnHub之DC靶场下载与DC靶场全系列渗透实战详细过程
- 诺诚健华通过注册:施一公家族身价15亿 高瓴浮亏5亿港元
- 华为HCIE云计算之Fusion Access桌面云
- Why general company will say "go back messages such as" after the end of the interview, rather than just tell the interviewer the result?
猜你喜欢

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

解码2022中国网安强星丨正向建、反向查,华为构建数字化时代的网络安全防线

Merge k sorted linked lists

file IO-buffer

音乐播放器(未完成版本)

RK3399 platform development series explanation (kernel-driven peripherals) 6.35, IAM20680 gyroscope introduction

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

BM7 list entry in central

配电网络扩展规划:考虑使用概率性能源生产和消费概况的决策(Matlab代码实现)

阿里云新增三大高性能计算解决方案,助力生命科学行业快速发展
随机推荐
B站数据分析岗实习生面试记录
LeetCode Daily Question (1573. Number of Ways to Split a String)
What would happen if disconnecting during the process of TCP connection?
Glide缓存核心原理详解
port forwarding
LeetCode Daily 2 Questions 02: Reverse the words in a string (1200 each)
STL-stack
IM 即时通讯开发如何设计图片文件的服务端存储架构
艺术与科技的狂欢,阿那亚2022砂之盒沉浸艺术季
特别的三杯鸡
Nodes in the linked list are flipped in groups of k
DC-9靶场下载及渗透实战详细过程(DC靶场系列)
2021IDEA创建web工程
H3C S5130 IRF做堆叠
68: Chapter 6: Develop article services: 1: Content sorting; article table introduction; creating [article] article services;
ArcGIS应用基础知识
MySQL:MySQL的集群——主从复制的原理和配置
Black cats take you learn Makefile article 13: a Makefile collection compile problem
基于交流潮流的电力系统多元件N-k故障模型研究(Matlab代码实现)【电力系统故障】
Pro-test is effective | A method to deal with missing features of risk control data