positive: "1.is来判断<br>groupName = params['groupName'] ##groupName的值是'url' reqBody['dim'] = groupName print(""reqBody_dim-SummaryListHandler"", reqBody['dim']) ## ('reqBody_dim-SummaryListHandler', u'url') print(""reqBody_dim_url-SummaryListHandler"", ('url' is reqBody['dim'])) ## ('reqBody_dim_url-SummaryListHandler', False) if groupName is 'url': 打印如下,看到通过is判断是false ('reqBody_dim-SummaryListHandler', u'url') ('reqBody_dim_url-SummaryListHandler', False)<br>2.id 和in<br>看到用in可以判断两个字符串相等<br>print(""groupName:"",groupName) reqBody['dim'] = groupName print(""reqBody_dim-SummaryListHandler"", reqBody['dim']) print(""reqBody_dim_url_is-SummaryListHandler"", ('url' is groupName)) print(""reqBody_dim_url_id-SummaryListHandler"", (id('url')==id(groupName))) print(""reqBody_dim_url_in-SummaryListHandler"", ('url' in groupName)) ('groupName:', u'url') ('reqBody_dim-SummaryListHandler', u'url') ('reqBody_dim_url_is-SummaryListHandler', False) ('reqBody_dim_url_id-SummaryListHandler', False) ('reqBody_dim_url_in-SummaryLis"
negative: 异或运算就是两个表达式同时为真或者同时为假的时候,结果为false,两个表达式中一个真一个假的时候,结果为ture。<br>打开VB编程,新建一个标准EXE。<br>新建一个命令按钮,将它的caption改为按钮,新建一个图片框,将它的名称改为A。<br>点击按钮进入代码编辑器,输入以下代码, A.print 7=7 xor 3=3 A.print 7=7 xor 3<>3 A.print 7<>7 xor 3<>3<br>从上面的代码可以知道,7=7为true,3=3为true,3<>3为false,7<>7为假。<br>好,现在解释执行一下。<br>真xor真=false,真xor假=真,假xor真=true,假xor假=false。<br>