Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in Python only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Member List
Calendar
Today's Posts
Home
Forum
Topic
Python
What are the syntax for &&, ||
What are the syntax for &&, ||
Collapse
This topic is closed.
X
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
RC
#1
What are the syntax for &&, ||
Oct 22 '08, 09:25 PM
if condition1 && condition2: # and
doThis
elif condition3 || condition4: # or
doThat
In most of language have &&, ||
How do I do in Python?
Peter Otten
#2
Oct 22 '08, 09:35 PM
Re: What are the syntax for &&, ||
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?
Comment
Post
Cancel
Tim Chase
#3
Oct 22 '08, 09:35 PM
Re: What are the syntax for &&, ||
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
Comment
Post
Cancel
Previous
template
Next
Working...
OK
OK
Cancel
👍
👎
☕
Comment