Skip to content

Instantly share code, notes, and snippets.

@JoFrhwld
Created December 4, 2013 16:24
Show Gist options
  • Save JoFrhwld/7790531 to your computer and use it in GitHub Desktop.
Save JoFrhwld/7790531 to your computer and use it in GitHub Desktop.
just playing around with python's `None` and how it interacts with logical comparisons.
theKingOfFrance = None
bald = ["JeanLucPicard", "StoneColdSteveAustin"]
print("Jean: The King of France is bald.")
if theKingOfFrance in bald:
print("Jaques: It's true!")
elif theKingOfFrance not in bald:
print("Jaques: It's false!")
print("")
print("France's throne is held by %s." % theKingOfFrance)
print("To say there is no King of France is %s." % (not theKingOfFrance))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment