Hi,<br><br>you could do it this way also :<br><br>if i in [3,5]:<br>    do something...<br><br>KM<br>~~~~~~~~~~~~~~~~~~~~~<br><div class="gmail_quote">On Fri, Feb 13, 2009 at 1:19 AM, Michele Simionato <span dir="ltr"><<a href="mailto:michele.simionato@gmail.com">michele.simionato@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d">On Feb 12, 5:07 pm, TechieInsights <<a href="mailto:GDoerm...@gmail.com">GDoerm...@gmail.com</a>> wrote:<br>

> On Feb 12, 9:03 am, Catherine Heathcote<br>
><br>
> <<a href="mailto:catherine.heathc...@gmail.com">catherine.heathc...@gmail.com</a>> wrote:<br>
> > But I just cant find it. How do I do an or, as in c/c++'s ||? Just<br>
> > trying to do something simple, the python equivilent of:<br>
><br>
> > if(i % 3 == 0 || i % 5 == 0)<br>
><br>
> > Thanks.<br>
><br>
> in 2.5 and above you can do<br>
> if any(i%3 == 0, i%5 == 0)<br>
<br>
</div>You are missing a few parenthesis: if any([i%3 == 0, i%5 == 0]) (but<br>
the idiomatic solution is to use or).<br>
<div><div></div><div class="Wj3C7c">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br>