Skip to content

Instantly share code, notes, and snippets.

@catichenor
Created February 2, 2018 23:33
Show Gist options
  • Save catichenor/7bb113de4e5444e1b6ed8b0efe09a8b9 to your computer and use it in GitHub Desktop.
Save catichenor/7bb113de4e5444e1b6ed8b0efe09a8b9 to your computer and use it in GitHub Desktop.
Demonstration of the difference between "is" and "==" in Python
test = 'hello'
print(test[:-1] == 'hell')
# returns "True"
print(test[:-1] is 'hell')
# returns "False", these do not point to the same object in memory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment