当前位置:网站首页>实例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)程序运行结果:
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓懒笑翻诚邀您点击下方群聊一起来学习讨论↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
边栏推荐
- 商家招募电商主播要考虑哪些内容
- RK3399 platform development series explanation (kernel-driven peripherals) 6.35, IAM20680 gyroscope introduction
- Common interview questions for APP UI automation testing, maybe useful~
- fme csmapreprojector转换器使用高程异常模型进行高程基准转换
- How many threads does LabVIEW allocate?
- DC-8靶场下载及渗透实战详细过程(DC靶场系列)
- BM13 determines whether a linked list is a palindrome
- GMT,UTC,CST,DST,RTC,NTP,SNTP,NITZ: 嵌入式的时间
- 阿里云张新涛:支持沉浸式体验应用快速落地,阿里云云XR平台发布
- Shell 编程--Sed
猜你喜欢

QT笔记——QT工具uic,rcc,moc,qmake的使用和介绍

Nodes in the linked list are flipped in groups of k

String类的常用方法

分享一个后台管理系统可拖拽式组件的设计思路

shell脚本

virtual address space

BM13判断一个链表是否为回文结构

DC-7靶场下载及渗透实战详细过程(DC靶场系列)

2021 IDEA creates web projects

Translating scientific and technological papers, how to translate from Russian to Chinese
随机推荐
瑞幸咖啡第二季营收33亿:门店达7195家 更换CFO
win系统下pytorch深度学习环境安装
Pro-test is effective | A method to deal with missing features of risk control data
Merge k sorted linked lists
A shell script the for loop statements, while statement
LeetCode每日两题02:反转字符串中的单词 (均1200道)
基于交流潮流的电力系统多元件N-k故障模型研究(Matlab代码实现)【电力系统故障】
How to translate financial annual report, why choose a professional translation company?
LeetCode Daily 2 Questions 02: Reverse the words in a string (1200 each)
过滤器
字节跳动原来这么容易就能进去...
Service - DNS forward and reverse domain name resolution service
Shell programming specification and variables
Black cat takes you to learn Makefile Part 12: Summary of common Makefile problems
云服务器基于 SSH 协议实现免密登录
亲测有效|处理风控数据特征缺失的一种方法
The Thread State,
shell programming without interaction
MySQL Advanced Commands
【开源教程5】疯壳·开源编队无人机-飞控固件烧写