Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created May 27, 2016 22:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuck0523/be4c8e35bbfd9ebf9f0f04b3f1c1760c to your computer and use it in GitHub Desktop.
Save chuck0523/be4c8e35bbfd9ebf9f0f04b3f1c1760c to your computer and use it in GitHub Desktop.
# coding: UTF-8
nums = [1, 2, 3, 4, 5]
# in: 存在確認
print(2 in nums) # True
print(6 in nums) # False
# not in: 非存在確認
print(2 not in nums) # False
print(6 not in nums) # True
# 関数ではなく演算子
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment