当前位置:网站首页>实例053:按位异或
实例053:按位异或
2022-08-10 22:20:00 【懒笑翻】
题目:学习使用按位异或 ^ 。
程序分析:0^0=0; 0^1=1; 1^0=1; 1^1=0
# 当两对应的二进位相异时,结果为1
代码:
a = 0o77
print(a)
print(a ^ 3)
print(a ^ 3 ^ 7)
运行结果:
边栏推荐
- 测试4年感觉和1、2年时没什么不同?这和应届生有什么区别?
- 【开源教程5】疯壳·开源编队无人机-飞控固件烧写
- RecyclerView滑动监听
- web项目访问引用jar内部的静态资源
- 威纶通触摸屏如何在报警的同时,显示出异常数据的当前值?
- ITK 读取一个目录中的一个序列,然后改变头信息,将多张dcm图像写成一个dcm文件。
- 配电网络扩展规划:考虑使用概率性能源生产和消费概况的决策(Matlab代码实现)
- MySQL: MySQL Cluster - Principle and Configuration of Master-Slave Replication
- 过滤器
- 【640. Solving Equations】
猜你喜欢
Qualcomm Platform Development Series Explanation (Application) Introduction to QCMAP Application Framework
【640. 求解方程】
交换机和生成树知识点
ArcGIS应用基础知识
诺诚健华通过注册:施一公家族身价15亿 高瓴浮亏5亿港元
12 Recurrent Neural Network RNN2 of Deep Learning
web项目访问引用jar内部的静态资源
Common interview questions for APP UI automation testing, maybe useful~
留言有奖|OpenBMB x 清华大学NLP:大模型公开课更新完结!
How many threads does LabVIEW allocate?
随机推荐
How to translate financial annual report, why choose a professional translation company?
RK3399 platform development series explanation (kernel-driven peripherals) 6.35, IAM20680 gyroscope introduction
QT笔记——vs + qt 创建一个带界面的 dll 和 调用带界面的dll
高通平台开发系列讲解(应用篇)QCMAP应用框架介绍
BM13判断一个链表是否为回文结构
12 Recurrent Neural Network RNN2 of Deep Learning
留言有奖|OpenBMB x 清华大学NLP:大模型公开课更新完结!
What is Jmeter? What are the principle steps used by Jmeter?
BM13 determines whether a linked list is a palindrome
DC-8靶场下载及渗透实战详细过程(DC靶场系列)
RecyclerView上下滑动时,不调用onBindViewHolder 导致列表的item不刷新
字节跳动原来这么容易就能进去...
Introduction to the use of counter instructions in Rockwell AB PLC RSLogix5000
68:第六章:开发文章服务:1:内容梳理;article表介绍;创建【article】文章服务;
Research on multi-element N-k fault model of power system based on AC power flow (implemented by Matlab code) [Power System Fault]
IM 即时通讯开发如何设计图片文件的服务端存储架构
leetcode:357. 统计各位数字都不同的数字个数
Detailed installation steps and environment configuration of geemap
CIKM2022 | Sequence Recommendation Based on Bidirectional Transformers Contrastive Learning
企业云存储日常运行维护实践经验分享