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

最新文章

  1. SpringMVC 工作原理
  2. [原创] zabbix学习之旅六:如何解决zabbix server在内网,而邮件发送服务器在外网的问题
  3. Bugs及解决方案列表
  4. 分布式系统之CAP理论
  5. Shell: extract more from listener.log(分析监听日志)
  6. alpha-咸鱼冲刺day9-紫仪
  7. SQL性能优化十条经验,后台程序员都需要掌握
  8. OpenCV编译以及QT Creator配置
  9. 使用ycsb对hbase0.94.11 benchmark
  10. secure CRT常用的查看服务器日志命令
  11. 计算机网络-数据结构-MAC帧头-IP头-TCP头-UDP头
  12. 搭建spark集群
  13. python里实现DSL
  14. 深入理解line-height与vertical-align(1)
  15. Hadoop学习之路(十)HDFS API的使用
  16. RANSAC算法在图像拼接上的应用的实现
  17. 48. Rotate Image (Array)
  18. Java Runnable和Thread区别
  19. wamp配置步骤
  20. golang使用rabbitMQ入门代码

热门文章

  1. dexposed框架Android在线热修复
  2. poj_3468线段树成段更新求区间和
  3. [TJOI2017] DNA 解题报告 (hash+二分)
  4. jquery.cookie.js插件删除不掉cookie的问题
  5. java的可查的异常和不可查的异常讲解
  6. Sql Server创建主键失败:CREATE UNIQUE INDEX 终止,因为发现对象名称 '[PPR_BasicInformation]' 和索引名称 '[PK_PPR_BasicInformation]' 有重复的键(E)
  7. 安装Windows服务方法
  8. 系统出现0x0000006B蓝屏修复,系统文件损坏 bootcat.cache、driver.stl
  9. ArrayList的使用方法
  10. 设置fixed,横向滚动条失效