473,499 Members | 1,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What are the syntax for &&, ||

RC

if condition1 && condition2: # and
doThis
elif condition3 || condition4: # or
doThat

In most of language have &&, ||

How do I do in Python?
Oct 22 '08 #1
2 1471
RC wrote:
if condition1 && condition2: # and
Â*Â*Â*Â*Â*Â*Â*Â*doThis
elif condition3 || condition4: # or
Â*Â*Â*Â*Â*Â*Â*Â*doThat
In most of language have &&, ||

How do I do in Python?
if condition1 and condition2: # &&
Â*Â*Â*Â*Â*Â*Â*Â*doThis
elif condition3 or condition4: # ||
Â*Â*Â*Â*Â*Â*Â*Â*doThat

See the pattern?
Oct 22 '08 #2
if condition1 && condition2: # and
doThis
elif condition3 || condition4: # or
doThat

In most of language have &&, ||

How do I do in Python?
Heh, you answered your own question in your comments:

if condition1 and condition2:
doThis()
elif cond3 or cond4:
doThat()

-tkc

Oct 22 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
5638
by: ian justice | last post by:
Before i post actual code, as i need a speedyish reply. Can i first ask if anyone knows off the top of their head, if there is a likely obvious cause to the following problem. For the moment i've...
4
3696
by: MS | last post by:
Just a general question here re VBA. Can anyone explain the differences between "!" and "." when refering to a control? eg Me!TxtBox and Me.TxtBox. What is difference between "+" and "&"...
4
1876
by: Joel | last post by:
Run this method: public void test() { bool b; int i=0; b=false; i=0; b=(b && i++==1);
4
2106
by: Peter Oliphant | last post by:
I've upgraded my code to VS C++.NET 2005 (Express) using /clr pure. My question is, why is there an exception to the rule in how pointer syntax is done in the event handlers? For example, why is...
9
4672
by: Let_Me_Be | last post by:
Hi all, I'm developing a small defensive programming toolkit for my own projects. So, here are my questions. 1) Is it possible to move from something like this: SAFECALL(foo();) to __safecall...
13
2776
by: Ragnar | last post by:
Hi, 2 issues left with my tidy-work: 1) Tidy transforms a "&amp;" in the source-xml into a "&" in the tidied version. My XML-Importer cannot handle it 2) in a long <title>-string a wrap is...
0
6711
by: Vijay | last post by:
Prep Courses for International Certifications, CSTE & CSQA & ISEB & ISTQB &Business Analyst & SOA Certifications in HYDERABAD. After receiving overwhelming response to our last 50+ batches, ...
18
2358
by: Andrew Wan | last post by:
I have been developing web applications with ASP & Javascript for a long time. I have been using Visual Studio 2003.NET. While VS2003 is okay for intellisense of ASP & Javascript, it's still not...
3
2185
by: Tony | last post by:
I see that many pages have &amp; in querystring instead &. What is difference? Can I put page link (url) www.mysite.com/mypage.aspx?lang=EN&ID=15 or I need to write...
0
7134
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7229
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7395
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5485
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4921
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3103
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
311
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.