Re: Embarrasing questio

2009-02-13 Thread Steven D'Aprano
TechieInsights wrote: On Feb 12, 9:03 am, Catherine Heathcote catherine.heathc...@gmail.com wrote: But I just cant find it. How do I do an or, as in c/c++'s ||? Just trying to do something simple, the python equivilent of: if(i % 3 == 0 || i % 5 == 0) Thanks. in 2.5 and above you can

Re: Embarrasing questio

2009-02-12 Thread TechieInsights
On Feb 12, 9:03 am, Catherine Heathcote catherine.heathc...@gmail.com wrote: But I just cant find it. How do I do an or, as in c/c++'s ||? Just trying to do something simple, the python equivilent of: if(i % 3 == 0 || i % 5 == 0) Thanks. if i % 3 == 0 or i % 5 == 0 --

Re: Embarrasing questio

2009-02-12 Thread TechieInsights
On Feb 12, 9:03 am, Catherine Heathcote catherine.heathc...@gmail.com wrote: But I just cant find it. How do I do an or, as in c/c++'s ||? Just trying to do something simple, the python equivilent of: if(i % 3 == 0 || i % 5 == 0) Thanks. in 2.5 and above you can do if any(i%3 == 0, i%5 ==

Re: Embarrasing questio

2009-02-12 Thread Aahz
In article zkxkl.34048$sp5.7...@text.news.virginmedia.com, Catherine Heathcote catherine.heathc...@gmail.com wrote: But I just cant find it. How do I do an or, as in c/c++'s ||? Just trying to do something simple, the python equivilent of: if(i % 3 == 0 || i % 5 == 0) if i % 3 == 0 or i % 5

Re: Embarrasing questio

2009-02-12 Thread Catherine Heathcote
TechieInsights wrote: On Feb 12, 9:03 am, Catherine Heathcote catherine.heathc...@gmail.com wrote: But I just cant find it. How do I do an or, as in c/c++'s ||? Just trying to do something simple, the python equivilent of: if(i % 3 == 0 || i % 5 == 0) Thanks. if i % 3 == 0 or i % 5 == 0

Re: Embarrasing questio

2009-02-12 Thread Michele Simionato
On Feb 12, 5:07 pm, TechieInsights gdoerm...@gmail.com wrote: On Feb 12, 9:03 am, Catherine Heathcote catherine.heathc...@gmail.com wrote: But I just cant find it. How do I do an or, as in c/c++'s ||? Just trying to do something simple, the python equivilent of: if(i % 3 == 0 || i % 5 ==

Re: Embarrasing questio

2009-02-12 Thread km
Hi, you could do it this way also : if i in [3,5]: do something... KM ~ On Fri, Feb 13, 2009 at 1:19 AM, Michele Simionato michele.simion...@gmail.com wrote: On Feb 12, 5:07 pm, TechieInsights gdoerm...@gmail.com wrote: On Feb 12, 9:03 am, Catherine Heathcote

Re: Embarrasing questio

2009-02-12 Thread Catherine Heathcote
Aahz wrote: In article zkxkl.34048$sp5.7...@text.news.virginmedia.com, Catherine Heathcote catherine.heathc...@gmail.com wrote: But I just cant find it. How do I do an or, as in c/c++'s ||? Just trying to do something simple, the python equivilent of: if(i % 3 == 0 || i % 5 == 0) if i % 3

Re: Embarrasing questio

2009-02-12 Thread Tim Rowe
2009/2/12 km srikrishnamo...@gmail.com: Hi, you could do it this way also : if i in [3,5]: do something... True, you could do it, but it would be wrong. The original is true for i = 6, 9, 10, 12 and so on, but yours doesn't seem to be... -- Tim Rowe --

Re: Embarrasing questio

2009-02-12 Thread TechieInsights
On Feb 12, 9:19 am, Michele Simionato michele.simion...@gmail.com wrote: On Feb 12, 5:07 pm, TechieInsights gdoerm...@gmail.com wrote: On Feb 12, 9:03 am, Catherine Heathcote catherine.heathc...@gmail.com wrote: But I just cant find it. How do I do an or, as in c/c++'s ||? Just trying

Re: Embarrasing questio

2009-02-12 Thread MRAB
Michele Simionato wrote: On Feb 12, 5:07 pm, TechieInsights gdoerm...@gmail.com wrote: On Feb 12, 9:03 am, Catherine Heathcote catherine.heathc...@gmail.com wrote: But I just cant find it. How do I do an or, as in c/c++'s ||? Just trying to do something simple, the python equivilent of: if(i

Re: Embarrasing questio

2009-02-12 Thread Michele Simionato
On Feb 12, 6:22 pm, MRAB goo...@mrabarnett.plus.com wrote: Michele Simionato wrote: On Feb 12, 5:07 pm, TechieInsights gdoerm...@gmail.com wrote: On Feb 12, 9:03 am, Catherine Heathcote catherine.heathc...@gmail.com wrote: But I just cant find it. How do I do an or, as in c/c++'s ||?

Re: Embarrasing questio

2009-02-12 Thread Hrvoje Niksic
Michele Simionato michele.simion...@gmail.com writes: On Feb 12, 6:22 pm, MRAB goo...@mrabarnett.plus.com wrote: Michele Simionato wrote: On Feb 12, 5:07 pm, TechieInsights gdoerm...@gmail.com wrote: On Feb 12, 9:03 am, Catherine Heathcote catherine.heathc...@gmail.com wrote: But I