<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<br><br>&gt; To: tutor@python.org<br>&gt; From: alan.gauld@btinternet.com<br>&gt; Date: Fri, 31 Jul 2009 17:09:48 +0100<br>&gt; Subject: Re: [Tutor] mnemonics to better learn Python<br>&gt; <br>&gt; <br>&gt; "Eduardo Vieira" &lt;eduardo.susan@gmail.com&gt; wrote<br>&gt; <br>&gt; &gt; Hello, would anybody have a good memorization technique for boolean<br>&gt; &gt; results? Like when using 'or'/'and' what it returns when both are<br>&gt; &gt; false, the last is false, etc?<br>&gt; <br>&gt; Hmm, I don't try to remember those, I just work it out based on <br>&gt; the meaning. <br>&gt; <br>&gt; A and B is true only if both A and B are True<br>&gt; A or B is true if either A or B is True.<br>&gt; <br>&gt; Thats it really, what's to remember?<br><br>I tend to agree, but since he asked for a mnemonic...<br><br>What Python Needs to Return a Boolean<br>AND:&nbsp; Both I demand! <br>OR:&nbsp;&nbsp;&nbsp; One or more.&nbsp; <br><br>So,<br><br>if A and B are False:<br>&nbsp;[think "Both I demand...are False")<br>if A or B are False:<br>&nbsp;[think "One or more...are False")<br>if A and B are True:<br>&nbsp;[think "Both I demand...are True")<br>etc.<br><br>Che<br><br><br /><hr />Windows Live™ SkyDrive™: Store, access, and share your photos. <a href='http://windowslive.com/Online/SkyDrive?ocid=TXT_TAGLM_WL_CS_SD_photos_072009' target='_new'>See how.</a></body>
</html>