01Python basics_03 Operators

<div class="iteye-blog-content-contain" style="font-size: 14px"><p><div id="cnblogs_post_body"></p>
<p> <p>  1. 成员运算符</p> </p>
<p> <p>  成员运算符,测试实例中包含了一系列的成员,包括字符串,列表或元组。</p> </p>
<p> <table style="width: 644px" border="0" cellspacing="0" cellpadding="0"> </p>
<p>  <tbody> </p>
<p>   <tr> </p>
<p>    <td valign="top" width="66"> <p>运算符</p> </td> </p>
<p>    <td valign="top" width="297"> <p>描述</p> </td> </p>
<p>    <td valign="top"> <p>实例</p> </td> </p>
<p>   </tr> </p>  </p> <p>   </tr> </p>  </p> <p>   </tr> </p>
<p>   <tr> </p>
<p>    <td valign="top" width="66"> <p>in</p> </td> </p>
<p>    <td valign="top" width="297"> <p>如果在指定的序列中找到值返回 True,否则返回 False。</p> </td> </p>
<p>    <td valign="top"> <p>x 在 y 序列中 , 如果 x 在 y 序列中返回 True。</p> </td> </p>
<p>   </tr> </p>
<p>   <tr> </p>
<p>    <td valign="top" width="66"> <p>not in</p> </td> </p>
<p>    <td valign="top" width="297"> <p>如果在指定的序列中没有找到值返回 True,否则返回 False。</p> </td> </p>
<p>    <td valign="top"> <p>x is not in the y sequence, returns True if x is not in the y sequence. </p> </td> </p>
<p>   </tr> </p>
<p>  </tbody> </p>
<p> </table> </p>
<p> <p style="text-align: left"> 2. Identity Operator</p> </p >
<p> <p style="text-<br> http://www.cppentry.com Introduction to Programming Development Programmers<br>align: left"> The identity operator is used to compare two storage unit for objects </p> </p>
<p> <table style="width: 644px"



<p>    <td valign="top"> <p>描述</p> </td> </p>
<p>    <td valign="top"> <p>实例</p> </td> </p>
<p>   </tr> </p>
<p>   <tr> </p>
<p>    <td valign="top"> <p>is</p> </td> </p>
<p>    <td valign="top"> <p>is 是判断两个标识符是不是引用自一个对象</p> </td> </p>
<p>   <td valign="top"> <p>x is y, 类似&nbsp;id(x) == id(y)&nbsp;, 如果引用的是同一个对象则返回 True,否则返回 False</p> </td> </p>
<p>   </tr> </p>
<p>   <tr> </p>









Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326446163&siteId=291194637