当前位置:网站首页>实例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)
运行结果:
边栏推荐
猜你喜欢
分享一个后台管理系统可拖拽式组件的设计思路
ThreadLocal comprehensive analysis (1)
测试4年感觉和1、2年时没什么不同?这和应届生有什么区别?
68: Chapter 6: Develop article services: 1: Content sorting; article table introduction; creating [article] article services;
边缘与云计算:哪种解决方案更适合您的连接设备?
DC-8靶场下载及渗透实战详细过程(DC靶场系列)
Redis
LeetCode每日两题02:反转字符串中的单词 (均1200道)
文件IO-缓冲区
字节跳动原来这么容易就能进去...
随机推荐
CFdiv2-Beautiful Mirrors-(期望)
交换机和生成树知识点
云服务器基于 SSH 协议实现免密登录
LeetCode Daily 2 Questions 01: Reverse Strings (both 1200) Method: Double Pointer
2022年8月的10篇论文推荐
Fatal error: cstring: No such file or directory
Redis
STL-deque
JS use regular expressions in g model and non g difference
2022年8月10日:使用 ASP.NET Core 为初学者构建 Web 应用程序--使用 ASP.NET Core 创建 Web UI(没看懂需要再看一遍)
fme csmapreprojector转换器使用高程异常模型进行高程基准转换
亲测有效|处理风控数据特征缺失的一种方法
测试4年感觉和1、2年时没什么不同?这和应届生有什么区别?
How many threads does LabVIEW allocate?
美味的佳肴
leetcode:357. 统计各位数字都不同的数字个数
Merge k sorted linked lists
罗克韦尔AB PLC RSLogix5000中计数器指令使用方法介绍
Introduction to the use of counter instructions in Rockwell AB PLC RSLogix5000
Service - DNS forward and reverse domain name resolution service