<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
<br><br>> To: tutor@python.org<br>> From: alan.gauld@btinternet.com<br>> Date: Fri, 31 Jul 2009 17:09:48 +0100<br>> Subject: Re: [Tutor] mnemonics to better learn Python<br>> <br>> <br>> "Eduardo Vieira" <eduardo.susan@gmail.com> wrote<br>> <br>> > Hello, would anybody have a good memorization technique for boolean<br>> > results? Like when using 'or'/'and' what it returns when both are<br>> > false, the last is false, etc?<br>> <br>> Hmm, I don't try to remember those, I just work it out based on <br>> the meaning. <br>> <br>> A and B is true only if both A and B are True<br>> A or B is true if either A or B is True.<br>> <br>> 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: Both I demand! <br>OR: One or more. <br><br>So,<br><br>if A and B are False:<br> [think "Both I demand...are False")<br>if A or B are False:<br> [think "One or more...are False")<br>if A and B are True:<br> [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>