当前位置:网站首页>实例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)
运行结果:
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓懒笑翻诚邀您点击下方群聊一起来学习讨论↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
边栏推荐
- Extended Chinese Remainder Theorem
- 企业云存储日常运行维护实践经验分享
- 【640. Solving Equations】
- RK3399平台开发系列讲解(内核驱动外设篇)6.35、IAM20680陀螺仪介绍
- 配电网络扩展规划:考虑使用概率性能源生产和消费概况的决策(Matlab代码实现)
- 艺术与科技的狂欢,阿那亚2022砂之盒沉浸艺术季
- 《DevOps围炉夜话》- Pilot - CNCF开源DevOps项目DevStream简介 - feat. PMC成员胡涛
- QT笔记——vs + qt 创建一个带界面的 dll 和 调用带界面的dll
- 金山云CEO王育林离职:正值冲刺港股之际 雷军曾送金砖
- 水果沙拉酱
猜你喜欢
GMT,UTC,CST,DST,RTC,NTP,SNTP,NITZ: 嵌入式的时间
ArcGIS应用基础知识
unusual understanding
String类的常用方法
geemap的详细安装步骤及环境配置
链表中的节点每k个一组翻转
Black cats take you learn Makefile article 13: a Makefile collection compile problem
RK3399 platform development series explanation (kernel-driven peripherals) 6.35, IAM20680 gyroscope introduction
测试4年感觉和1、2年时没什么不同?这和应届生有什么区别?
2021 IDEA creates web projects
随机推荐
Use Cloudreve to build a private cloud disk
2021 IDEA creates web projects
fme csmapreprojector转换器使用高程异常模型进行高程基准转换
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
计算需要的MIPI lane数目
美味的石井饭
STL-stack
Research on multi-element N-k fault model of power system based on AC power flow (implemented by Matlab code) [Power System Fault]
"DevOps Night Talk" - Pilot - Introduction to CNCF Open Source DevOps Project DevStream - feat. PMC member Hu Tao
3598. 二叉树遍历(华中科技大学考研机试题)
Pro-test is effective | A method to deal with missing features of risk control data
Qualcomm Platform Development Series Explanation (Application) Introduction to QCMAP Application Framework
阿里云新增三大高性能计算解决方案,助力生命科学行业快速发展
STL-stack
The perfect alternative to domestic Gravatar avatars Cravatar
OneNote 教程,如何在 OneNote 中整理笔记本?
JS学习 2022080
DC-9靶场下载及渗透实战详细过程(DC靶场系列)
MySQL:MySQL的集群——主从复制的原理和配置
68:第六章:开发文章服务:1:内容梳理;article表介绍;创建【article】文章服务;