Skip to content

Instantly share code, notes, and snippets.

@JohnsonLuu
Created May 28, 2020 22:47
Show Gist options
  • Save JohnsonLuu/42dfa2ae6f6031968fa09d6da7854166 to your computer and use it in GitHub Desktop.
Save JohnsonLuu/42dfa2ae6f6031968fa09d6da7854166 to your computer and use it in GitHub Desktop.
"""
Create a function named always_false() that has one parameter named num.
Using an if statement, your variable num, and the operators >, and <, make it so your function will return False no matter what number is stored in num.
An if statement that is always false is called a contradiction. You will rarely want to do this while programming, but it is important to realize it is possible to do this.
"""
# Write your always_false function here:
def always_false(num):
if num >= 0 and num <=0:
return False
else:
return False
# Uncomment these function calls to test your always_false function:
print(always_false(0))
# should print False
print(always_false(-1))
# should print False
print(always_false(1))
# should print False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment