The in operator
2024-08-31 13:56:42
The operators we have seen so far are all special characters like + and *, but there are a few operators that are words. in is a boolean operator that takes two strings and returns True if the first appears as a substring in the second:
For example, the following function prints all the letters from word1 that also appear in word2:
With well-chosen variable names, Python sometimes reads like English. You could read this loop, ‘for (each) letter in (the first) word, if (the) letter (appears) in (the second) word, print (the) letter.
from Thinking in Python
最新文章
- SpringMVC 工作原理
- [原创] zabbix学习之旅六:如何解决zabbix server在内网,而邮件发送服务器在外网的问题
- Bugs及解决方案列表
- 分布式系统之CAP理论
- Shell: extract more from listener.log(分析监听日志)
- alpha-咸鱼冲刺day9-紫仪
- SQL性能优化十条经验,后台程序员都需要掌握
- OpenCV编译以及QT Creator配置
- 使用ycsb对hbase0.94.11 benchmark
- secure CRT常用的查看服务器日志命令
- 计算机网络-数据结构-MAC帧头-IP头-TCP头-UDP头
- 搭建spark集群
- python里实现DSL
- 深入理解line-height与vertical-align(1)
- Hadoop学习之路(十)HDFS API的使用
- RANSAC算法在图像拼接上的应用的实现
- 48. Rotate Image (Array)
- Java Runnable和Thread区别
- wamp配置步骤
- golang使用rabbitMQ入门代码
热门文章
- dexposed框架Android在线热修复
- poj_3468线段树成段更新求区间和
- [TJOI2017] DNA 解题报告 (hash+二分)
- jquery.cookie.js插件删除不掉cookie的问题
- java的可查的异常和不可查的异常讲解
- Sql Server创建主键失败:CREATE UNIQUE INDEX 终止,因为发现对象名称 '[PPR_BasicInformation]' 和索引名称 '[PK_PPR_BasicInformation]' 有重复的键(E)
- 安装Windows服务方法
- 系统出现0x0000006B蓝屏修复,系统文件损坏 bootcat.cache、driver.stl
- ArrayList的使用方法
- 设置fixed,横向滚动条失效