Re: Embarrasing questio

2009-02-13 Thread Steven D'Aprano
TechieInsights wrote: > On Feb 12, 9:03 am, Catherine Heathcote > 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

Re: Embarrasing questio

2009-02-12 Thread Hrvoje Niksic
Michele Simionato writes: > On Feb 12, 6:22 pm, MRAB wrote: >> Michele Simionato wrote: >> > On Feb 12, 5:07 pm, TechieInsights wrote: >> >> On Feb 12, 9:03 am, Catherine Heathcote >> >> >> wrote: >> >>> But I just cant find it. How do I do an or, as in c/c++'s ||? Just >> >>> trying to do som

Re: Embarrasing questio

2009-02-12 Thread Michele Simionato
On Feb 12, 6:22 pm, MRAB wrote: > Michele Simionato wrote: > > On Feb 12, 5:07 pm, TechieInsights wrote: > >> On Feb 12, 9:03 am, Catherine Heathcote > > >> 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

Re: Embarrasing questio

2009-02-12 Thread MRAB
Michele Simionato wrote: On Feb 12, 5:07 pm, TechieInsights wrote: On Feb 12, 9:03 am, Catherine Heathcote 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

Re: Embarrasing questio

2009-02-12 Thread TechieInsights
On Feb 12, 9:19 am, Michele Simionato wrote: > On Feb 12, 5:07 pm, TechieInsights wrote: > > > On Feb 12, 9:03 am, Catherine Heathcote > > > 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 Tim Rowe
2009/2/12 km : > 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 -- http://mail.python.org/mailman/listinfo/python-list

Re: Embarrasing questio

2009-02-12 Thread Catherine Heathcote
Aahz wrote: In article , Catherine Heathcote 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 == 0: You may find it worthwhile to quickly step through ever

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 wrote: > > On Feb 12, 9:03 am, Catherine Heathcote > > > > wrote: > > >

Re: Embarrasing questio

2009-02-12 Thread Michele Simionato
On Feb 12, 5:07 pm, TechieInsights wrote: > On Feb 12, 9:03 am, Catherine Heathcote > > 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

Re: Embarrasing questio

2009-02-12 Thread Catherine Heathcote
TechieInsights wrote: On Feb 12, 9:03 am, Catherine Heathcote 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 Yea, new it would be embarras

Re: Embarrasing questio

2009-02-12 Thread Aahz
In article , Catherine Heathcote 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 == 0: You may find it worthwhile to quickly step through everything in

Re: Embarrasing questio

2009-02-12 Thread TechieInsights
On Feb 12, 9:03 am, Catherine Heathcote 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 == 0) -- http://mail.python.

Re: Embarrasing questio

2009-02-12 Thread TechieInsights
On Feb 12, 9:03 am, Catherine Heathcote 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 -- http://mail.python.org/mailman/listinfo/pyth

Embarrasing questio

2009-02-12 Thread Catherine Heathcote
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. -- http://mail.python.org/mailman/listinfo/python-list