当前位置:网站首页>实例051:按位与
实例051:按位与
2022-08-10 22:20:00 【懒笑翻】
题目:学习使用按位与 & 。
程序分析:0&0=0; 0&1=0; 1&0=0; 1&1=1。
# 只有对应的两个二进位均为1时,结果位才为1 ,否则为0。
代码:
a = 0o77
print(a)
b = a & 3
print(b)
b = b & 7
print(b)
程序运行结果:
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓懒笑翻诚邀您点击下方群聊一起来学习讨论↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
边栏推荐
- CIKM2022 | 基于双向Transformers对比学习的序列推荐
- DC-7靶场下载及渗透实战详细过程(DC靶场系列)
- ITK 读取一个目录中的一个序列,然后改变头信息,将多张dcm图像写成一个dcm文件。
- 云服务器基于 SSH 协议实现免密登录
- unusual understanding
- ArcGIS应用基础知识
- 阿里云架构师金云龙:基于云XR平台的视觉计算应用部署
- 德科立科创板上市:年营收7.3亿 市值59亿
- 链表相加(二)
- August 10, 2022: Building Web Applications for Beginners with ASP.NET Core -- Creating Web UIs with ASP.NET Core
猜你喜欢
Introduction to the use of counter instructions in Rockwell AB PLC RSLogix5000
CFdiv2-Beautiful Mirrors-(期望)
QT笔记——vs + qt 创建一个带界面的 dll 和 调用带界面的dll
shell programming without interaction
IM 即时通讯开发如何设计图片文件的服务端存储架构
BM7 list entry in central
Glide监听Activity生命周期源码分析
2021 IDEA creates web projects
BM13 determines whether a linked list is a palindrome
瑞幸咖啡第二季营收33亿:门店达7195家 更换CFO
随机推荐
链表中的节点每k个一组翻转
【开源教程5】疯壳·开源编队无人机-飞控固件烧写
阿里云架构师金云龙:基于云XR平台的视觉计算应用部署
fme csmapreprojector转换器使用高程异常模型进行高程基准转换
亲测有效|处理风控数据特征缺失的一种方法
合并k个已排序的链表
JS学习 2022080
How does the Weiluntong touch screen display the current value of abnormal data while alarming?
高学历毕业生,该学单片机还是plc?
“数据引擎”开启前装规模量产新赛道,「智协慧同」崭露头角
This visual tool artifact is more intuitive and easy to use!love so much
Detailed installation steps and environment configuration of geemap
Introduction to the use of counter instructions in Rockwell AB PLC RSLogix5000
Service - DHCP principle and configuration
水果沙拉酱
LeetCode Daily 2 Questions 01: Reverse Strings (both 1200) Method: Double Pointer
CFdiv2-Beautiful Mirrors-(期望)
gcc492 compile `.rodata‘ can not be used when making a PIE object; recompile with -fPIE
ITK 读取一个目录中的一个序列,然后改变头信息,将多张dcm图像写成一个dcm文件。
MySQL:MySQL的集群——主从复制的原理和配置