Skip to content

Instantly share code, notes, and snippets.

@tarunama tarunama/file0.py
Last active Aug 29, 2015

Embed
What would you like to do?
[Python] return A [or / and] B ref: http://qiita.com/tarunama/items/bd51d1a1097bac9b8453
def hoge:(self)
return A or B
def and_in_return1():
return 1 == 1 and 1 == 1
def and_in_return2():
return 1 == 0 and 1 == 1
def and_in_return3():
return 1 == 1 and 1 == 0
print(and_in_return1()) # True
print(and_in_return2()) # False
print(and_in_return3()) # False
def or_in_return1():
return 1 == 1 or 1 == 1
def or_in_return2():
return 1 == 0 or 1 == 0
def or_in_return3():
return 1 == 1 or 1 == 0
print(or_in_return1()) # True
print(or_in_return2()) # False
print(or_in_return3()) # True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.