当前位置:网站首页>实例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)程序运行结果:
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓懒笑翻诚邀您点击下方群聊一起来学习讨论↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
边栏推荐
- 解码2022中国网安强星丨正向建、反向查,华为构建数字化时代的网络安全防线
- An article to teach you a quick start and basic explanation of Pytest, be sure to read
- Power system power flow calculation (Newton-Raphson method, Gauss-Seidel method, fast decoupling method) (Matlab code implementation)
- DC-8靶场下载及渗透实战详细过程(DC靶场系列)
- uni-app微信小程序——下拉多选框
- Leave a message with a prize | OpenBMB x Tsinghua University NLP: The update of the large model open class is complete!
- 2022年8月的10篇论文推荐
- VulnHub之DC靶场下载与DC靶场全系列渗透实战详细过程
- TCP连接过程中如果拔掉网线会发生什么?
- Shell 编程--Sed
猜你喜欢

如何成为一名正义黑客?你应该学习什么?

边缘与云计算:哪种解决方案更适合您的连接设备?

shell programming without interaction

CFdiv2-Beautiful Mirrors-(期望)

自学软件测试不知道该如何学起,【软件测试技能图谱|自学测试路线图】

shell编程之免交互

"DevOps Night Talk" - Pilot - Introduction to CNCF Open Source DevOps Project DevStream - feat. PMC member Hu Tao

学会开会|成为有连接感组织的重要技能

BM13 determines whether a linked list is a palindrome

DC-9靶场下载及渗透实战详细过程(DC靶场系列)
随机推荐
高学历毕业生,该学单片机还是plc?
fme csmapreprojector转换器使用高程异常模型进行高程基准转换
68:第六章:开发文章服务:1:内容梳理;article表介绍;创建【article】文章服务;
web项目访问引用jar内部的静态资源
阿里云张新涛:支持沉浸式体验应用快速落地,阿里云云XR平台发布
RecyclerView设置缓存大小
Glide缓存核心原理详解
高通平台开发系列讲解(应用篇)QCMAP应用框架介绍
Common interview questions for APP UI automation testing, maybe useful~
An article to teach you a quick start and basic explanation of Pytest, be sure to read
This visual tool artifact is more intuitive and easy to use!love so much
基于交流潮流的电力系统多元件N-k故障模型研究(Matlab代码实现)【电力系统故障】
STL-stack
【软件测试】2022年最火的十大测试工具,你掌握了几个
RK3399平台开发系列讲解(内核驱动外设篇)6.35、IAM20680陀螺仪介绍
68: Chapter 6: Develop article services: 1: Content sorting; article table introduction; creating [article] article services;
自学软件测试不知道该如何学起,【软件测试技能图谱|自学测试路线图】
QT笔记——用VS + qt 生成dll 和 调用生成的dll
阿里云架构师金云龙:基于云XR平台的视觉计算应用部署
CFdiv2-Common Number-(奇偶数二分+规律)