当前位置:网站首页>实例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)
运行结果:
边栏推荐
- 配电网络扩展规划:考虑使用概率性能源生产和消费概况的决策(Matlab代码实现)
- LabVIEW分配多少线程?
- 企业云存储日常运行维护实践经验分享
- String类的常用方法
- TCP连接过程中如果拔掉网线会发生什么?
- gcc492 compile `.rodata‘ can not be used when making a PIE object; recompile with -fPIE
- 留言有奖|OpenBMB x 清华大学NLP:大模型公开课更新完结!
- 12 Recurrent Neural Network RNN2 of Deep Learning
- shell脚本
- 华为HCIE云计算之Fusion Access桌面云
猜你喜欢
解码2022中国网安强星丨正向建、反向查,华为构建数字化时代的网络安全防线
QT笔记——用VS + qt 生成dll 和 调用生成的dll
What are the concepts, purposes, processes, and testing methods of interface testing?
leetcode:357. 统计各位数字都不同的数字个数
如何成为一名正义黑客?你应该学习什么?
68:第六章:开发文章服务:1:内容梳理;article表介绍;创建【article】文章服务;
自学软件测试不知道该如何学起,【软件测试技能图谱|自学测试路线图】
[Maui official version] Create a cross-platform Maui program, as well as the implementation and demonstration of dependency injection and MVVM two-way binding
测试4年感觉和1、2年时没什么不同?这和应届生有什么区别?
geemap的详细安装步骤及环境配置
随机推荐
2021IDEA创建web工程
IM 即时通讯开发如何设计图片文件的服务端存储架构
华为HCIE云计算之Fusion Access桌面云
BM13 determines whether a linked list is a palindrome
CFdiv2-Beautiful Mirrors-(期望)
y93.第六章 微服务、服务网格及Envoy实战 -- Envoy配置(四)
高通平台开发系列讲解(应用篇)QCMAP应用框架介绍
BM7 链表中环的入口结点
Research on multi-element N-k fault model of power system based on AC power flow (implemented by Matlab code) [Power System Fault]
web项目访问引用jar内部的静态资源
What is Jmeter? What are the principle steps used by Jmeter?
fme csmapreprojector转换器使用高程异常模型进行高程基准转换
leetcode:357. 统计各位数字都不同的数字个数
阿里云张新涛:支持沉浸式体验应用快速落地,阿里云云XR平台发布
STL-deque
file IO-buffer
诺诚健华通过注册:施一公家族身价15亿 高瓴浮亏5亿港元
make & cmake
The Thread State,
艺术与科技的狂欢,阿那亚2022砂之盒沉浸艺术季