Skip to content

Instantly share code, notes, and snippets.

@enseitankad0
Created March 1, 2018 15:02
Show Gist options
  • Save enseitankad0/a0b9b3b1038216170e333a854f85783d to your computer and use it in GitHub Desktop.
Save enseitankad0/a0b9b3b1038216170e333a854f85783d to your computer and use it in GitHub Desktop.
##### LOGICAL OPERATORS ######
## the same as in Java
## < > <= => | ==
#1 not highest priority
#2 and
#3 or lowest priority
a = True
b = False
print(not a) #is [a] a false? NO
print(not b) #is [b] a false? YES
print(a and b) #logical: t+f=f
print(a or b) #logical: t+f=t
a = 1
b = 5
c = 'KAMIL'
d = 'MAGDALENA'
f = False
print(not(not(a>b) or f) and a ) #false
print(not(not(a>b) or f) or a ) #1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment